{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from lstm import LstmParam, LstmNetwork\n",
    "\n",
    "class ToyLossLayer:\n",
    "    \"\"\"\n",
    "    Computes square loss with first element of hidden layer array.\n",
    "    \"\"\"\n",
    "    @classmethod\n",
    "    def loss(self, pred, label):\n",
    "        return (pred[0] - label) ** 2\n",
    "\n",
    "    @classmethod\n",
    "    def bottom_diff(self, pred, label):\n",
    "        diff = np.zeros_like(pred)\n",
    "        diff[0] = 2 * (pred[0] - label)\n",
    "        return diff\n",
    "\n",
    "np.random.seed(0)\n",
    "\n",
    "# parameters for input data dimension and lstm cell count\n",
    "mem_cell_ct = 100\n",
    "x_dim = 50\n",
    "lstm_param = LstmParam(mem_cell_ct, x_dim)\n",
    "\n",
    "lstm_net = LstmNetwork(lstm_param)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-0.5, 0.2, 0.1, -0.5]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_list =[-0.5, 0.2, 0.1, -0.5]\n",
    "# y_list = [-0.8, 0.3, 0.5, -0.8]\n",
    "# ymax=np.max(np.abs(y_list))*1.2\n",
    "# y_list=y_list/ymax\n",
    "y_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[array([ 0.9065555 ,  0.77404733,  0.33314515,  0.08110139,  0.40724117,\n",
       "         0.23223414,  0.13248763,  0.05342718,  0.72559436,  0.01142746,\n",
       "         0.77058075,  0.14694665,  0.07952208,  0.08960303,  0.67204781,\n",
       "         0.24536721,  0.42053947,  0.55736879,  0.86055117,  0.72704426,\n",
       "         0.27032791,  0.1314828 ,  0.05537432,  0.30159863,  0.26211815,\n",
       "         0.45614057,  0.68328134,  0.69562545,  0.28351885,  0.37992696,\n",
       "         0.18115096,  0.78854551,  0.05684808,  0.69699724,  0.7786954 ,\n",
       "         0.77740756,  0.25942256,  0.37381314,  0.58759964,  0.2728219 ,\n",
       "         0.3708528 ,  0.19705428,  0.45985588,  0.0446123 ,  0.79979588,\n",
       "         0.07695645,  0.51883515,  0.3068101 ,  0.57754295,  0.95943334]),\n",
       " array([ 0.64557024,  0.03536244,  0.43040244,  0.51001685,  0.53617749,\n",
       "         0.68139251,  0.2775961 ,  0.12886057,  0.39267568,  0.95640572,\n",
       "         0.18713089,  0.90398395,  0.54380595,  0.45691142,  0.88204141,\n",
       "         0.45860396,  0.72416764,  0.39902532,  0.90404439,  0.69002502,\n",
       "         0.69962205,  0.3277204 ,  0.75677864,  0.63606106,  0.24002027,\n",
       "         0.16053882,  0.79639147,  0.9591666 ,  0.45813883,  0.59098417,\n",
       "         0.85772264,  0.45722345,  0.95187448,  0.57575116,  0.82076712,\n",
       "         0.90884372,  0.81552382,  0.15941446,  0.62889844,  0.39843426,\n",
       "         0.06271295,  0.42403225,  0.25868407,  0.84903831,  0.03330463,\n",
       "         0.95898272,  0.35536885,  0.35670689,  0.0163285 ,  0.18523233]),\n",
       " array([ 0.4012595 ,  0.92929142,  0.09961493,  0.94530153,  0.86948853,\n",
       "         0.4541624 ,  0.32670088,  0.23274413,  0.61446471,  0.03307459,\n",
       "         0.01560606,  0.42879572,  0.06807407,  0.25194099,  0.22116092,\n",
       "         0.25319119,  0.13105523,  0.01203622,  0.1154843 ,  0.61848026,\n",
       "         0.97425621,  0.990345  ,  0.4090541 ,  0.16295443,  0.63876176,\n",
       "         0.49030535,  0.98940978,  0.06530421,  0.78323444,  0.2883985 ,\n",
       "         0.24141862,  0.66250457,  0.24606318,  0.66585912,  0.51730852,\n",
       "         0.42408899,  0.55468781,  0.28705152,  0.70657471,  0.41485687,\n",
       "         0.36054556,  0.82865691,  0.92496691,  0.04600731,  0.23262699,\n",
       "         0.34851937,  0.81496648,  0.98549143,  0.9689717 ,  0.90494835]),\n",
       " array([ 0.29655627,  0.99201124,  0.24942004,  0.10590615,  0.95095261,\n",
       "         0.23342026,  0.68976827,  0.05835636,  0.7307091 ,  0.88172021,\n",
       "         0.2724369 ,  0.3790569 ,  0.37429618,  0.74878826,  0.23780724,\n",
       "         0.1718531 ,  0.44929165,  0.30446841,  0.83918912,  0.23774183,\n",
       "         0.50238946,  0.9425836 ,  0.6339977 ,  0.86728941,  0.94020969,\n",
       "         0.75076486,  0.69957506,  0.96796557,  0.99440079,  0.45182168,\n",
       "         0.07086978,  0.29279403,  0.15235471,  0.41748637,  0.13128933,\n",
       "         0.6041178 ,  0.38280806,  0.89538588,  0.96779467,  0.5468849 ,\n",
       "         0.27482357,  0.59223042,  0.89676116,  0.40673335,  0.55207828,\n",
       "         0.27165277,  0.45544415,  0.40171354,  0.24841347,  0.50586638])]"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "input_val_arr = [np.random.random(x_dim) for _ in y_list]\n",
    "input_val_arr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter  0: y_pred = [ 0.07677,  0.07189,  0.06560,  0.15562], loss: 7.801e-01\n",
      "iter  1: y_pred = [-0.20333, -0.26575, -0.29087, -0.35910], loss: 4.776e-01\n",
      "iter  2: y_pred = [-0.16439, -0.18865, -0.20994, -0.27491], loss: 4.104e-01\n",
      "iter  3: y_pred = [-0.15905, -0.16728, -0.18979, -0.26000], loss: 3.927e-01\n",
      "iter  4: y_pred = [-0.16035, -0.15655, -0.18085, -0.25820], loss: 3.798e-01\n",
      "iter  5: y_pred = [-0.16446, -0.15014, -0.17637, -0.26182], loss: 3.683e-01\n",
      "iter  6: y_pred = [-0.16997, -0.14580, -0.17400, -0.26814], loss: 3.573e-01\n",
      "iter  7: y_pred = [-0.17622, -0.14250, -0.17264, -0.27581], loss: 3.467e-01\n",
      "iter  8: y_pred = [-0.18287, -0.13973, -0.17171, -0.28411], loss: 3.364e-01\n",
      "iter  9: y_pred = [-0.18972, -0.13720, -0.17091, -0.29262], loss: 3.264e-01\n",
      "iter 10: y_pred = [-0.19664, -0.13476, -0.17006, -0.30107], loss: 3.166e-01\n",
      "iter 11: y_pred = [-0.20358, -0.13233, -0.16908, -0.30931], loss: 3.071e-01\n",
      "iter 12: y_pred = [-0.21049, -0.12989, -0.16793, -0.31727], loss: 2.978e-01\n",
      "iter 13: y_pred = [-0.21735, -0.12742, -0.16660, -0.32489], loss: 2.888e-01\n",
      "iter 14: y_pred = [-0.22414, -0.12492, -0.16511, -0.33215], loss: 2.801e-01\n",
      "iter 15: y_pred = [-0.23087, -0.12241, -0.16347, -0.33906], loss: 2.717e-01\n",
      "iter 16: y_pred = [-0.23750, -0.11990, -0.16169, -0.34562], loss: 2.636e-01\n",
      "iter 17: y_pred = [-0.24405, -0.11739, -0.15979, -0.35184], loss: 2.557e-01\n",
      "iter 18: y_pred = [-0.25051, -0.11490, -0.15780, -0.35773], loss: 2.481e-01\n",
      "iter 19: y_pred = [-0.25687, -0.11242, -0.15574, -0.36331], loss: 2.408e-01\n",
      "iter 20: y_pred = [-0.26311, -0.10998, -0.15361, -0.36859], loss: 2.338e-01\n",
      "iter 21: y_pred = [-0.26925, -0.10757, -0.15143, -0.37359], loss: 2.270e-01\n",
      "iter 22: y_pred = [-0.27527, -0.10520, -0.14922, -0.37832], loss: 2.206e-01\n",
      "iter 23: y_pred = [-0.28116, -0.10288, -0.14698, -0.38280], loss: 2.144e-01\n",
      "iter 24: y_pred = [-0.28692, -0.10059, -0.14473, -0.38704], loss: 2.084e-01\n",
      "iter 25: y_pred = [-0.29256, -0.09836, -0.14248, -0.39105], loss: 2.027e-01\n",
      "iter 26: y_pred = [-0.29805, -0.09618, -0.14023, -0.39485], loss: 1.973e-01\n",
      "iter 27: y_pred = [-0.30341, -0.09405, -0.13799, -0.39844], loss: 1.921e-01\n",
      "iter 28: y_pred = [-0.30863, -0.09196, -0.13576, -0.40185], loss: 1.871e-01\n",
      "iter 29: y_pred = [-0.31371, -0.08993, -0.13356, -0.40508], loss: 1.823e-01\n",
      "iter 30: y_pred = [-0.31865, -0.08796, -0.13138, -0.40814], loss: 1.778e-01\n",
      "iter 31: y_pred = [-0.32345, -0.08603, -0.12922, -0.41104], loss: 1.734e-01\n",
      "iter 32: y_pred = [-0.32812, -0.08415, -0.12710, -0.41380], loss: 1.693e-01\n",
      "iter 33: y_pred = [-0.33264, -0.08233, -0.12502, -0.41642], loss: 1.653e-01\n",
      "iter 34: y_pred = [-0.33702, -0.08055, -0.12296, -0.41891], loss: 1.616e-01\n",
      "iter 35: y_pred = [-0.34127, -0.07882, -0.12095, -0.42127], loss: 1.580e-01\n",
      "iter 36: y_pred = [-0.34539, -0.07714, -0.11897, -0.42352], loss: 1.545e-01\n",
      "iter 37: y_pred = [-0.34938, -0.07551, -0.11703, -0.42566], loss: 1.512e-01\n",
      "iter 38: y_pred = [-0.35325, -0.07392, -0.11513, -0.42771], loss: 1.481e-01\n",
      "iter 39: y_pred = [-0.35699, -0.07237, -0.11328, -0.42965], loss: 1.451e-01\n",
      "iter 40: y_pred = [-0.36061, -0.07087, -0.11146, -0.43151], loss: 1.422e-01\n",
      "iter 41: y_pred = [-0.36411, -0.06941, -0.10968, -0.43329], loss: 1.395e-01\n",
      "iter 42: y_pred = [-0.36750, -0.06799, -0.10794, -0.43498], loss: 1.368e-01\n",
      "iter 43: y_pred = [-0.37078, -0.06661, -0.10624, -0.43661], loss: 1.343e-01\n",
      "iter 44: y_pred = [-0.37395, -0.06526, -0.10458, -0.43816], loss: 1.319e-01\n",
      "iter 45: y_pred = [-0.37702, -0.06395, -0.10296, -0.43965], loss: 1.296e-01\n",
      "iter 46: y_pred = [-0.37999, -0.06268, -0.10138, -0.44107], loss: 1.274e-01\n",
      "iter 47: y_pred = [-0.38286, -0.06144, -0.09983, -0.44244], loss: 1.253e-01\n",
      "iter 48: y_pred = [-0.38564, -0.06023, -0.09832, -0.44375], loss: 1.233e-01\n",
      "iter 49: y_pred = [-0.38833, -0.05906, -0.09685, -0.44501], loss: 1.214e-01\n",
      "iter 50: y_pred = [-0.39093, -0.05791, -0.09541, -0.44623], loss: 1.195e-01\n",
      "iter 51: y_pred = [-0.39344, -0.05679, -0.09401, -0.44739], loss: 1.177e-01\n",
      "iter 52: y_pred = [-0.39588, -0.05570, -0.09264, -0.44852], loss: 1.160e-01\n",
      "iter 53: y_pred = [-0.39824, -0.05464, -0.09130, -0.44960], loss: 1.143e-01\n",
      "iter 54: y_pred = [-0.40052, -0.05360, -0.08999, -0.45064], loss: 1.127e-01\n",
      "iter 55: y_pred = [-0.40273, -0.05259, -0.08872, -0.45165], loss: 1.112e-01\n",
      "iter 56: y_pred = [-0.40487, -0.05160, -0.08748, -0.45262], loss: 1.097e-01\n",
      "iter 57: y_pred = [-0.40695, -0.05063, -0.08626, -0.45356], loss: 1.083e-01\n",
      "iter 58: y_pred = [-0.40896, -0.04969, -0.08508, -0.45447], loss: 1.070e-01\n",
      "iter 59: y_pred = [-0.41090, -0.04876, -0.08392, -0.45534], loss: 1.056e-01\n",
      "iter 60: y_pred = [-0.41279, -0.04786, -0.08279, -0.45619], loss: 1.044e-01\n",
      "iter 61: y_pred = [-0.41462, -0.04697, -0.08168, -0.45702], loss: 1.031e-01\n",
      "iter 62: y_pred = [-0.41639, -0.04610, -0.08061, -0.45781], loss: 1.020e-01\n",
      "iter 63: y_pred = [-0.41811, -0.04525, -0.07955, -0.45859], loss: 1.008e-01\n",
      "iter 64: y_pred = [-0.41978, -0.04441, -0.07852, -0.45934], loss: 9.969e-02\n",
      "iter 65: y_pred = [-0.42140, -0.04359, -0.07752, -0.46006], loss: 9.862e-02\n",
      "iter 66: y_pred = [-0.42297, -0.04278, -0.07653, -0.46077], loss: 9.758e-02\n",
      "iter 67: y_pred = [-0.42450, -0.04198, -0.07557, -0.46146], loss: 9.657e-02\n",
      "iter 68: y_pred = [-0.42598, -0.04120, -0.07463, -0.46212], loss: 9.559e-02\n",
      "iter 69: y_pred = [-0.42742, -0.04043, -0.07372, -0.46277], loss: 9.464e-02\n",
      "iter 70: y_pred = [-0.42882, -0.03967, -0.07282, -0.46340], loss: 9.371e-02\n",
      "iter 71: y_pred = [-0.43018, -0.03892, -0.07194, -0.46402], loss: 9.282e-02\n",
      "iter 72: y_pred = [-0.43150, -0.03818, -0.07108, -0.46462], loss: 9.194e-02\n",
      "iter 73: y_pred = [-0.43278, -0.03745, -0.07024, -0.46520], loss: 9.109e-02\n",
      "iter 74: y_pred = [-0.43403, -0.03673, -0.06942, -0.46578], loss: 9.026e-02\n",
      "iter 75: y_pred = [-0.43525, -0.03601, -0.06861, -0.46633], loss: 8.946e-02\n",
      "iter 76: y_pred = [-0.43644, -0.03530, -0.06782, -0.46688], loss: 8.867e-02\n",
      "iter 77: y_pred = [-0.43759, -0.03459, -0.06705, -0.46741], loss: 8.790e-02\n",
      "iter 78: y_pred = [-0.43871, -0.03389, -0.06630, -0.46793], loss: 8.715e-02\n",
      "iter 79: y_pred = [-0.43980, -0.03320, -0.06556, -0.46843], loss: 8.641e-02\n",
      "iter 80: y_pred = [-0.44087, -0.03251, -0.06483, -0.46893], loss: 8.569e-02\n",
      "iter 81: y_pred = [-0.44191, -0.03182, -0.06412, -0.46941], loss: 8.498e-02\n",
      "iter 82: y_pred = [-0.44293, -0.03113, -0.06343, -0.46989], loss: 8.429e-02\n",
      "iter 83: y_pred = [-0.44392, -0.03044, -0.06274, -0.47036], loss: 8.361e-02\n",
      "iter 84: y_pred = [-0.44488, -0.02976, -0.06208, -0.47081], loss: 8.295e-02\n",
      "iter 85: y_pred = [-0.44583, -0.02907, -0.06142, -0.47126], loss: 8.229e-02\n",
      "iter 86: y_pred = [-0.44675, -0.02839, -0.06078, -0.47170], loss: 8.165e-02\n",
      "iter 87: y_pred = [-0.44765, -0.02770, -0.06015, -0.47213], loss: 8.101e-02\n",
      "iter 88: y_pred = [-0.44853, -0.02701, -0.05953, -0.47256], loss: 8.038e-02\n",
      "iter 89: y_pred = [-0.44939, -0.02632, -0.05892, -0.47298], loss: 7.977e-02\n",
      "iter 90: y_pred = [-0.45024, -0.02562, -0.05833, -0.47339], loss: 7.916e-02\n",
      "iter 91: y_pred = [-0.45106, -0.02492, -0.05774, -0.47379], loss: 7.856e-02\n",
      "iter 92: y_pred = [-0.45187, -0.02422, -0.05717, -0.47418], loss: 7.796e-02\n",
      "iter 93: y_pred = [-0.45267, -0.02351, -0.05661, -0.47457], loss: 7.737e-02\n",
      "iter 94: y_pred = [-0.45345, -0.02280, -0.05606, -0.47496], loss: 7.679e-02\n",
      "iter 95: y_pred = [-0.45421, -0.02208, -0.05552, -0.47534], loss: 7.621e-02\n",
      "iter 96: y_pred = [-0.45496, -0.02136, -0.05499, -0.47571], loss: 7.564e-02\n",
      "iter 97: y_pred = [-0.45570, -0.02063, -0.05447, -0.47608], loss: 7.507e-02\n",
      "iter 98: y_pred = [-0.45643, -0.01989, -0.05395, -0.47644], loss: 7.451e-02\n",
      "iter 99: y_pred = [-0.45714, -0.01915, -0.05345, -0.47680], loss: 7.395e-02\n",
      "iter 100: y_pred = [-0.45785, -0.01840, -0.05296, -0.47715], loss: 7.339e-02\n",
      "iter 101: y_pred = [-0.45854, -0.01764, -0.05247, -0.47750], loss: 7.284e-02\n",
      "iter 102: y_pred = [-0.45922, -0.01688, -0.05200, -0.47785], loss: 7.229e-02\n",
      "iter 103: y_pred = [-0.45989, -0.01611, -0.05153, -0.47819], loss: 7.175e-02\n",
      "iter 104: y_pred = [-0.46056, -0.01533, -0.05108, -0.47852], loss: 7.121e-02\n",
      "iter 105: y_pred = [-0.46121, -0.01455, -0.05063, -0.47885], loss: 7.067e-02\n",
      "iter 106: y_pred = [-0.46186, -0.01376, -0.05019, -0.47918], loss: 7.014e-02\n",
      "iter 107: y_pred = [-0.46250, -0.01297, -0.04976, -0.47951], loss: 6.961e-02\n",
      "iter 108: y_pred = [-0.46313, -0.01217, -0.04933, -0.47983], loss: 6.908e-02\n",
      "iter 109: y_pred = [-0.46376, -0.01136, -0.04892, -0.48014], loss: 6.856e-02\n",
      "iter 110: y_pred = [-0.46438, -0.01055, -0.04851, -0.48046], loss: 6.804e-02\n",
      "iter 111: y_pred = [-0.46499, -0.00973, -0.04811, -0.48076], loss: 6.752e-02\n",
      "iter 112: y_pred = [-0.46560, -0.00891, -0.04772, -0.48107], loss: 6.701e-02\n",
      "iter 113: y_pred = [-0.46620, -0.00809, -0.04734, -0.48137], loss: 6.650e-02\n",
      "iter 114: y_pred = [-0.46679, -0.00726, -0.04697, -0.48167], loss: 6.599e-02\n",
      "iter 115: y_pred = [-0.46738, -0.00643, -0.04660, -0.48197], loss: 6.549e-02\n",
      "iter 116: y_pred = [-0.46797, -0.00559, -0.04624, -0.48226], loss: 6.500e-02\n",
      "iter 117: y_pred = [-0.46855, -0.00476, -0.04589, -0.48254], loss: 6.450e-02\n",
      "iter 118: y_pred = [-0.46912, -0.00392, -0.04554, -0.48283], loss: 6.401e-02\n",
      "iter 119: y_pred = [-0.46969, -0.00308, -0.04521, -0.48311], loss: 6.353e-02\n",
      "iter 120: y_pred = [-0.47026, -0.00223, -0.04488, -0.48338], loss: 6.305e-02\n",
      "iter 121: y_pred = [-0.47082, -0.00138, -0.04455, -0.48366], loss: 6.257e-02\n",
      "iter 122: y_pred = [-0.47138, -0.00054, -0.04424, -0.48392], loss: 6.210e-02\n",
      "iter 123: y_pred = [-0.47193,  0.00031, -0.04393, -0.48419], loss: 6.163e-02\n",
      "iter 124: y_pred = [-0.47247,  0.00116, -0.04362, -0.48444], loss: 6.116e-02\n",
      "iter 125: y_pred = [-0.47301,  0.00202, -0.04333, -0.48470], loss: 6.070e-02\n",
      "iter 126: y_pred = [-0.47355,  0.00287, -0.04304, -0.48495], loss: 6.024e-02\n",
      "iter 127: y_pred = [-0.47408,  0.00373, -0.04275, -0.48519], loss: 5.979e-02\n",
      "iter 128: y_pred = [-0.47461,  0.00459, -0.04248, -0.48543], loss: 5.934e-02\n",
      "iter 129: y_pred = [-0.47513,  0.00546, -0.04221, -0.48567], loss: 5.889e-02\n",
      "iter 130: y_pred = [-0.47564,  0.00633, -0.04194, -0.48590], loss: 5.845e-02\n",
      "iter 131: y_pred = [-0.47615,  0.00720, -0.04168, -0.48612], loss: 5.801e-02\n",
      "iter 132: y_pred = [-0.47666,  0.00807, -0.04143, -0.48634], loss: 5.757e-02\n",
      "iter 133: y_pred = [-0.47716,  0.00895, -0.04118, -0.48655], loss: 5.713e-02\n",
      "iter 134: y_pred = [-0.47765,  0.00984, -0.04093, -0.48676], loss: 5.670e-02\n",
      "iter 135: y_pred = [-0.47814,  0.01073, -0.04070, -0.48696], loss: 5.627e-02\n",
      "iter 136: y_pred = [-0.47863,  0.01163, -0.04046, -0.48716], loss: 5.583e-02\n",
      "iter 137: y_pred = [-0.47911,  0.01254, -0.04024, -0.48735], loss: 5.540e-02\n",
      "iter 138: y_pred = [-0.47958,  0.01345, -0.04001, -0.48753], loss: 5.498e-02\n",
      "iter 139: y_pred = [-0.48005,  0.01438, -0.03980, -0.48771], loss: 5.455e-02\n",
      "iter 140: y_pred = [-0.48051,  0.01531, -0.03958, -0.48787], loss: 5.412e-02\n",
      "iter 141: y_pred = [-0.48097,  0.01626, -0.03937, -0.48804], loss: 5.369e-02\n",
      "iter 142: y_pred = [-0.48142,  0.01722, -0.03917, -0.48819], loss: 5.326e-02\n",
      "iter 143: y_pred = [-0.48186,  0.01819, -0.03897, -0.48834], loss: 5.283e-02\n",
      "iter 144: y_pred = [-0.48230,  0.01918, -0.03877, -0.48848], loss: 5.240e-02\n",
      "iter 145: y_pred = [-0.48274,  0.02018, -0.03858, -0.48861], loss: 5.197e-02\n",
      "iter 146: y_pred = [-0.48317,  0.02120, -0.03839, -0.48873], loss: 5.153e-02\n",
      "iter 147: y_pred = [-0.48359,  0.02224, -0.03821, -0.48885], loss: 5.109e-02\n",
      "iter 148: y_pred = [-0.48401,  0.02330, -0.03803, -0.48895], loss: 5.065e-02\n",
      "iter 149: y_pred = [-0.48443,  0.02438, -0.03785, -0.48905], loss: 5.021e-02\n",
      "iter 150: y_pred = [-0.48484,  0.02549, -0.03768, -0.48914], loss: 4.976e-02\n",
      "iter 151: y_pred = [-0.48524,  0.02661, -0.03751, -0.48921], loss: 4.931e-02\n",
      "iter 152: y_pred = [-0.48564,  0.02777, -0.03734, -0.48928], loss: 4.885e-02\n",
      "iter 153: y_pred = [-0.48604,  0.02895, -0.03718, -0.48934], loss: 4.839e-02\n",
      "iter 154: y_pred = [-0.48643,  0.03016, -0.03702, -0.48939], loss: 4.792e-02\n",
      "iter 155: y_pred = [-0.48681,  0.03140, -0.03687, -0.48943], loss: 4.744e-02\n",
      "iter 156: y_pred = [-0.48719,  0.03268, -0.03671, -0.48945], loss: 4.696e-02\n",
      "iter 157: y_pred = [-0.48757,  0.03399, -0.03656, -0.48947], loss: 4.647e-02\n",
      "iter 158: y_pred = [-0.48794,  0.03534, -0.03641, -0.48947], loss: 4.598e-02\n",
      "iter 159: y_pred = [-0.48831,  0.03673, -0.03627, -0.48947], loss: 4.547e-02\n",
      "iter 160: y_pred = [-0.48867,  0.03817, -0.03613, -0.48945], loss: 4.496e-02\n",
      "iter 161: y_pred = [-0.48903,  0.03964, -0.03598, -0.48942], loss: 4.444e-02\n",
      "iter 162: y_pred = [-0.48939,  0.04117, -0.03584, -0.48938], loss: 4.391e-02\n",
      "iter 163: y_pred = [-0.48974,  0.04274, -0.03571, -0.48933], loss: 4.336e-02\n",
      "iter 164: y_pred = [-0.49008,  0.04437, -0.03557, -0.48927], loss: 4.281e-02\n",
      "iter 165: y_pred = [-0.49042,  0.04605, -0.03543, -0.48920], loss: 4.225e-02\n",
      "iter 166: y_pred = [-0.49076,  0.04779, -0.03530, -0.48912], loss: 4.168e-02\n",
      "iter 167: y_pred = [-0.49109,  0.04960, -0.03517, -0.48902], loss: 4.109e-02\n",
      "iter 168: y_pred = [-0.49142,  0.05146, -0.03503, -0.48892], loss: 4.049e-02\n",
      "iter 169: y_pred = [-0.49174,  0.05339, -0.03490, -0.48881], loss: 3.989e-02\n",
      "iter 170: y_pred = [-0.49206,  0.05539, -0.03476, -0.48869], loss: 3.926e-02\n",
      "iter 171: y_pred = [-0.49237,  0.05745, -0.03462, -0.48856], loss: 3.863e-02\n",
      "iter 172: y_pred = [-0.49268,  0.05960, -0.03448, -0.48843], loss: 3.799e-02\n",
      "iter 173: y_pred = [-0.49297,  0.06181, -0.03434, -0.48829], loss: 3.733e-02\n",
      "iter 174: y_pred = [-0.49326,  0.06411, -0.03419, -0.48814], loss: 3.666e-02\n",
      "iter 175: y_pred = [-0.49354,  0.06648, -0.03404, -0.48799], loss: 3.598e-02\n",
      "iter 176: y_pred = [-0.49381,  0.06893, -0.03389, -0.48783], loss: 3.529e-02\n",
      "iter 177: y_pred = [-0.49408,  0.07147, -0.03373, -0.48767], loss: 3.459e-02\n",
      "iter 178: y_pred = [-0.49433,  0.07408, -0.03356, -0.48750], loss: 3.388e-02\n",
      "iter 179: y_pred = [-0.49457,  0.07678, -0.03338, -0.48734], loss: 3.316e-02\n",
      "iter 180: y_pred = [-0.49480,  0.07956, -0.03320, -0.48718], loss: 3.244e-02\n",
      "iter 181: y_pred = [-0.49501,  0.08242, -0.03300, -0.48701], loss: 3.171e-02\n",
      "iter 182: y_pred = [-0.49522,  0.08536, -0.03279, -0.48685], loss: 3.097e-02\n",
      "iter 183: y_pred = [-0.49541,  0.08837, -0.03257, -0.48669], loss: 3.024e-02\n",
      "iter 184: y_pred = [-0.49558,  0.09145, -0.03234, -0.48653], loss: 2.950e-02\n",
      "iter 185: y_pred = [-0.49574,  0.09460, -0.03209, -0.48638], loss: 2.876e-02\n",
      "iter 186: y_pred = [-0.49589,  0.09781, -0.03183, -0.48623], loss: 2.803e-02\n",
      "iter 187: y_pred = [-0.49603,  0.10107, -0.03155, -0.48608], loss: 2.730e-02\n",
      "iter 188: y_pred = [-0.49615,  0.10439, -0.03124, -0.48595], loss: 2.658e-02\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 189: y_pred = [-0.49625,  0.10774, -0.03092, -0.48582], loss: 2.587e-02\n",
      "iter 190: y_pred = [-0.49634,  0.11112, -0.03058, -0.48570], loss: 2.517e-02\n",
      "iter 191: y_pred = [-0.49642,  0.11452, -0.03022, -0.48559], loss: 2.448e-02\n",
      "iter 192: y_pred = [-0.49649,  0.11794, -0.02983, -0.48548], loss: 2.381e-02\n",
      "iter 193: y_pred = [-0.49655,  0.12135, -0.02942, -0.48538], loss: 2.316e-02\n",
      "iter 194: y_pred = [-0.49660,  0.12476, -0.02898, -0.48530], loss: 2.252e-02\n",
      "iter 195: y_pred = [-0.49664,  0.12814, -0.02852, -0.48522], loss: 2.191e-02\n",
      "iter 196: y_pred = [-0.49667,  0.13149, -0.02803, -0.48515], loss: 2.132e-02\n",
      "iter 197: y_pred = [-0.49670,  0.13481, -0.02752, -0.48509], loss: 2.074e-02\n",
      "iter 198: y_pred = [-0.49672,  0.13807, -0.02698, -0.48503], loss: 2.019e-02\n",
      "iter 199: y_pred = [-0.49674,  0.14126, -0.02641, -0.48499], loss: 1.967e-02\n",
      "iter 200: y_pred = [-0.49676,  0.14439, -0.02582, -0.48495], loss: 1.916e-02\n",
      "iter 201: y_pred = [-0.49677,  0.14744, -0.02520, -0.48491], loss: 1.868e-02\n",
      "iter 202: y_pred = [-0.49679,  0.15041, -0.02456, -0.48489], loss: 1.821e-02\n",
      "iter 203: y_pred = [-0.49681,  0.15329, -0.02390, -0.48487], loss: 1.777e-02\n",
      "iter 204: y_pred = [-0.49682,  0.15607, -0.02322, -0.48485], loss: 1.735e-02\n",
      "iter 205: y_pred = [-0.49685,  0.15875, -0.02251, -0.48484], loss: 1.695e-02\n",
      "iter 206: y_pred = [-0.49687,  0.16134, -0.02178, -0.48483], loss: 1.657e-02\n",
      "iter 207: y_pred = [-0.49690,  0.16382, -0.02103, -0.48483], loss: 1.620e-02\n",
      "iter 208: y_pred = [-0.49694,  0.16619, -0.02027, -0.48482], loss: 1.585e-02\n",
      "iter 209: y_pred = [-0.49698,  0.16846, -0.01949, -0.48483], loss: 1.551e-02\n",
      "iter 210: y_pred = [-0.49702,  0.17063, -0.01869, -0.48483], loss: 1.519e-02\n",
      "iter 211: y_pred = [-0.49707,  0.17270, -0.01788, -0.48483], loss: 1.488e-02\n",
      "iter 212: y_pred = [-0.49712,  0.17466, -0.01705, -0.48484], loss: 1.458e-02\n",
      "iter 213: y_pred = [-0.49718,  0.17653, -0.01622, -0.48484], loss: 1.430e-02\n",
      "iter 214: y_pred = [-0.49725,  0.17830, -0.01537, -0.48485], loss: 1.402e-02\n",
      "iter 215: y_pred = [-0.49732,  0.17998, -0.01452, -0.48486], loss: 1.375e-02\n",
      "iter 216: y_pred = [-0.49739,  0.18158, -0.01365, -0.48487], loss: 1.349e-02\n",
      "iter 217: y_pred = [-0.49747,  0.18308, -0.01278, -0.48488], loss: 1.324e-02\n",
      "iter 218: y_pred = [-0.49755,  0.18451, -0.01191, -0.48489], loss: 1.300e-02\n",
      "iter 219: y_pred = [-0.49763,  0.18586, -0.01103, -0.48489], loss: 1.276e-02\n",
      "iter 220: y_pred = [-0.49772,  0.18714, -0.01014, -0.48490], loss: 1.253e-02\n",
      "iter 221: y_pred = [-0.49781,  0.18835, -0.00925, -0.48491], loss: 1.230e-02\n",
      "iter 222: y_pred = [-0.49790,  0.18949, -0.00835, -0.48492], loss: 1.208e-02\n",
      "iter 223: y_pred = [-0.49799,  0.19057, -0.00746, -0.48493], loss: 1.187e-02\n",
      "iter 224: y_pred = [-0.49809,  0.19159, -0.00656, -0.48494], loss: 1.166e-02\n",
      "iter 225: y_pred = [-0.49818,  0.19255, -0.00566, -0.48495], loss: 1.145e-02\n",
      "iter 226: y_pred = [-0.49828,  0.19347, -0.00476, -0.48496], loss: 1.125e-02\n",
      "iter 227: y_pred = [-0.49838,  0.19433, -0.00386, -0.48497], loss: 1.105e-02\n",
      "iter 228: y_pred = [-0.49848,  0.19515, -0.00296, -0.48498], loss: 1.085e-02\n",
      "iter 229: y_pred = [-0.49858,  0.19592, -0.00206, -0.48499], loss: 1.066e-02\n",
      "iter 230: y_pred = [-0.49867,  0.19666, -0.00116, -0.48501], loss: 1.047e-02\n",
      "iter 231: y_pred = [-0.49877,  0.19736, -0.00026, -0.48502], loss: 1.029e-02\n",
      "iter 232: y_pred = [-0.49887,  0.19802,  0.00064, -0.48503], loss: 1.010e-02\n",
      "iter 233: y_pred = [-0.49897,  0.19865,  0.00154, -0.48504], loss: 9.922e-03\n",
      "iter 234: y_pred = [-0.49906,  0.19924,  0.00243, -0.48506], loss: 9.744e-03\n",
      "iter 235: y_pred = [-0.49916,  0.19981,  0.00333, -0.48507], loss: 9.569e-03\n",
      "iter 236: y_pred = [-0.49925,  0.20035,  0.00422, -0.48508], loss: 9.397e-03\n",
      "iter 237: y_pred = [-0.49935,  0.20087,  0.00511, -0.48510], loss: 9.227e-03\n",
      "iter 238: y_pred = [-0.49944,  0.20136,  0.00600, -0.48512], loss: 9.059e-03\n",
      "iter 239: y_pred = [-0.49953,  0.20183,  0.00689, -0.48513], loss: 8.893e-03\n",
      "iter 240: y_pred = [-0.49962,  0.20227,  0.00778, -0.48515], loss: 8.730e-03\n",
      "iter 241: y_pred = [-0.49971,  0.20270,  0.00867, -0.48517], loss: 8.569e-03\n",
      "iter 242: y_pred = [-0.49979,  0.20311,  0.00955, -0.48519], loss: 8.410e-03\n",
      "iter 243: y_pred = [-0.49988,  0.20350,  0.01043, -0.48521], loss: 8.254e-03\n",
      "iter 244: y_pred = [-0.49996,  0.20387,  0.01131, -0.48524], loss: 8.099e-03\n",
      "iter 245: y_pred = [-0.50004,  0.20423,  0.01219, -0.48526], loss: 7.946e-03\n",
      "iter 246: y_pred = [-0.50012,  0.20457,  0.01306, -0.48528], loss: 7.795e-03\n",
      "iter 247: y_pred = [-0.50020,  0.20489,  0.01394, -0.48531], loss: 7.646e-03\n",
      "iter 248: y_pred = [-0.50028,  0.20521,  0.01481, -0.48534], loss: 7.499e-03\n",
      "iter 249: y_pred = [-0.50035,  0.20551,  0.01568, -0.48537], loss: 7.354e-03\n",
      "iter 250: y_pred = [-0.50043,  0.20580,  0.01655, -0.48540], loss: 7.211e-03\n",
      "iter 251: y_pred = [-0.50050,  0.20607,  0.01741, -0.48543], loss: 7.070e-03\n",
      "iter 252: y_pred = [-0.50057,  0.20634,  0.01828, -0.48546], loss: 6.930e-03\n",
      "iter 253: y_pred = [-0.50063,  0.20660,  0.01914, -0.48550], loss: 6.792e-03\n",
      "iter 254: y_pred = [-0.50070,  0.20684,  0.02000, -0.48553], loss: 6.656e-03\n",
      "iter 255: y_pred = [-0.50076,  0.20708,  0.02086, -0.48557], loss: 6.522e-03\n",
      "iter 256: y_pred = [-0.50083,  0.20730,  0.02171, -0.48561], loss: 6.390e-03\n",
      "iter 257: y_pred = [-0.50089,  0.20752,  0.02257, -0.48565], loss: 6.259e-03\n",
      "iter 258: y_pred = [-0.50095,  0.20772,  0.02342, -0.48569], loss: 6.130e-03\n",
      "iter 259: y_pred = [-0.50100,  0.20792,  0.02427, -0.48574], loss: 6.003e-03\n",
      "iter 260: y_pred = [-0.50106,  0.20811,  0.02511, -0.48578], loss: 5.877e-03\n",
      "iter 261: y_pred = [-0.50111,  0.20830,  0.02596, -0.48583], loss: 5.753e-03\n",
      "iter 262: y_pred = [-0.50116,  0.20847,  0.02680, -0.48588], loss: 5.631e-03\n",
      "iter 263: y_pred = [-0.50121,  0.20864,  0.02764, -0.48593], loss: 5.511e-03\n",
      "iter 264: y_pred = [-0.50126,  0.20880,  0.02847, -0.48598], loss: 5.392e-03\n",
      "iter 265: y_pred = [-0.50131,  0.20895,  0.02931, -0.48604], loss: 5.275e-03\n",
      "iter 266: y_pred = [-0.50135,  0.20910,  0.03014, -0.48609], loss: 5.159e-03\n",
      "iter 267: y_pred = [-0.50140,  0.20924,  0.03096, -0.48615], loss: 5.045e-03\n",
      "iter 268: y_pred = [-0.50144,  0.20937,  0.03179, -0.48621], loss: 4.933e-03\n",
      "iter 269: y_pred = [-0.50148,  0.20950,  0.03261, -0.48627], loss: 4.822e-03\n",
      "iter 270: y_pred = [-0.50152,  0.20962,  0.03343, -0.48633], loss: 4.713e-03\n",
      "iter 271: y_pred = [-0.50155,  0.20973,  0.03424, -0.48640], loss: 4.606e-03\n",
      "iter 272: y_pred = [-0.50159,  0.20984,  0.03506, -0.48646], loss: 4.500e-03\n",
      "iter 273: y_pred = [-0.50162,  0.20994,  0.03587, -0.48653], loss: 4.396e-03\n",
      "iter 274: y_pred = [-0.50166,  0.21003,  0.03667, -0.48660], loss: 4.294e-03\n",
      "iter 275: y_pred = [-0.50169,  0.21012,  0.03747, -0.48667], loss: 4.193e-03\n",
      "iter 276: y_pred = [-0.50172,  0.21021,  0.03827, -0.48674], loss: 4.093e-03\n",
      "iter 277: y_pred = [-0.50175,  0.21029,  0.03906, -0.48682], loss: 3.996e-03\n",
      "iter 278: y_pred = [-0.50177,  0.21036,  0.03985, -0.48689], loss: 3.900e-03\n",
      "iter 279: y_pred = [-0.50180,  0.21043,  0.04064, -0.48697], loss: 3.805e-03\n",
      "iter 280: y_pred = [-0.50182,  0.21049,  0.04142, -0.48705], loss: 3.712e-03\n",
      "iter 281: y_pred = [-0.50184,  0.21055,  0.04220, -0.48713], loss: 3.621e-03\n",
      "iter 282: y_pred = [-0.50187,  0.21060,  0.04297, -0.48721], loss: 3.531e-03\n",
      "iter 283: y_pred = [-0.50189,  0.21065,  0.04374, -0.48730], loss: 3.443e-03\n",
      "iter 284: y_pred = [-0.50190,  0.21069,  0.04451, -0.48738], loss: 3.356e-03\n",
      "iter 285: y_pred = [-0.50192,  0.21072,  0.04527, -0.48747], loss: 3.271e-03\n",
      "iter 286: y_pred = [-0.50194,  0.21076,  0.04602, -0.48756], loss: 3.188e-03\n",
      "iter 287: y_pred = [-0.50195,  0.21079,  0.04677, -0.48765], loss: 3.106e-03\n",
      "iter 288: y_pred = [-0.50197,  0.21081,  0.04752, -0.48774], loss: 3.026e-03\n",
      "iter 289: y_pred = [-0.50198,  0.21083,  0.04826, -0.48783], loss: 2.947e-03\n",
      "iter 290: y_pred = [-0.50199,  0.21084,  0.04899, -0.48793], loss: 2.869e-03\n",
      "iter 291: y_pred = [-0.50200,  0.21085,  0.04972, -0.48802], loss: 2.793e-03\n",
      "iter 292: y_pred = [-0.50201,  0.21086,  0.05044, -0.48812], loss: 2.719e-03\n",
      "iter 293: y_pred = [-0.50202,  0.21086,  0.05116, -0.48822], loss: 2.646e-03\n",
      "iter 294: y_pred = [-0.50202,  0.21086,  0.05187, -0.48831], loss: 2.575e-03\n",
      "iter 295: y_pred = [-0.50203,  0.21085,  0.05258, -0.48841], loss: 2.505e-03\n",
      "iter 296: y_pred = [-0.50203,  0.21084,  0.05328, -0.48851], loss: 2.436e-03\n",
      "iter 297: y_pred = [-0.50204,  0.21083,  0.05398, -0.48862], loss: 2.369e-03\n",
      "iter 298: y_pred = [-0.50204,  0.21081,  0.05467, -0.48872], loss: 2.303e-03\n",
      "iter 299: y_pred = [-0.50204,  0.21079,  0.05535, -0.48882], loss: 2.239e-03\n",
      "iter 300: y_pred = [-0.50204,  0.21077,  0.05603, -0.48893], loss: 2.176e-03\n",
      "iter 301: y_pred = [-0.50204,  0.21074,  0.05670, -0.48903], loss: 2.115e-03\n",
      "iter 302: y_pred = [-0.50204,  0.21071,  0.05736, -0.48914], loss: 2.055e-03\n",
      "iter 303: y_pred = [-0.50204,  0.21067,  0.05802, -0.48924], loss: 1.996e-03\n",
      "iter 304: y_pred = [-0.50204,  0.21063,  0.05867, -0.48935], loss: 1.939e-03\n",
      "iter 305: y_pred = [-0.50204,  0.21059,  0.05931, -0.48946], loss: 1.883e-03\n",
      "iter 306: y_pred = [-0.50203,  0.21055,  0.05995, -0.48957], loss: 1.828e-03\n",
      "iter 307: y_pred = [-0.50203,  0.21050,  0.06058, -0.48968], loss: 1.775e-03\n",
      "iter 308: y_pred = [-0.50202,  0.21045,  0.06121, -0.48979], loss: 1.722e-03\n",
      "iter 309: y_pred = [-0.50202,  0.21040,  0.06183, -0.48990], loss: 1.671e-03\n",
      "iter 310: y_pred = [-0.50201,  0.21035,  0.06244, -0.49001], loss: 1.622e-03\n",
      "iter 311: y_pred = [-0.50200,  0.21029,  0.06304, -0.49012], loss: 1.573e-03\n",
      "iter 312: y_pred = [-0.50199,  0.21023,  0.06364, -0.49023], loss: 1.526e-03\n",
      "iter 313: y_pred = [-0.50198,  0.21017,  0.06423, -0.49034], loss: 1.480e-03\n",
      "iter 314: y_pred = [-0.50197,  0.21010,  0.06482, -0.49045], loss: 1.435e-03\n",
      "iter 315: y_pred = [-0.50196,  0.21004,  0.06539, -0.49056], loss: 1.391e-03\n",
      "iter 316: y_pred = [-0.50195,  0.20997,  0.06596, -0.49067], loss: 1.349e-03\n",
      "iter 317: y_pred = [-0.50194,  0.20990,  0.06653, -0.49078], loss: 1.307e-03\n",
      "iter 318: y_pred = [-0.50193,  0.20983,  0.06708, -0.49089], loss: 1.267e-03\n",
      "iter 319: y_pred = [-0.50192,  0.20975,  0.06763, -0.49100], loss: 1.227e-03\n",
      "iter 320: y_pred = [-0.50191,  0.20968,  0.06818, -0.49111], loss: 1.189e-03\n",
      "iter 321: y_pred = [-0.50189,  0.20960,  0.06871, -0.49123], loss: 1.152e-03\n",
      "iter 322: y_pred = [-0.50188,  0.20952,  0.06924, -0.49134], loss: 1.115e-03\n",
      "iter 323: y_pred = [-0.50187,  0.20944,  0.06976, -0.49145], loss: 1.080e-03\n",
      "iter 324: y_pred = [-0.50185,  0.20936,  0.07028, -0.49156], loss: 1.046e-03\n",
      "iter 325: y_pred = [-0.50184,  0.20928,  0.07078, -0.49166], loss: 1.012e-03\n",
      "iter 326: y_pred = [-0.50182,  0.20919,  0.07129, -0.49177], loss: 9.800e-04\n",
      "iter 327: y_pred = [-0.50181,  0.20911,  0.07178, -0.49188], loss: 9.485e-04\n",
      "iter 328: y_pred = [-0.50179,  0.20902,  0.07227, -0.49199], loss: 9.179e-04\n",
      "iter 329: y_pred = [-0.50177,  0.20893,  0.07275, -0.49210], loss: 8.881e-04\n",
      "iter 330: y_pred = [-0.50176,  0.20884,  0.07322, -0.49221], loss: 8.592e-04\n",
      "iter 331: y_pred = [-0.50174,  0.20876,  0.07369, -0.49231], loss: 8.312e-04\n",
      "iter 332: y_pred = [-0.50173,  0.20867,  0.07415, -0.49242], loss: 8.039e-04\n",
      "iter 333: y_pred = [-0.50171,  0.20858,  0.07460, -0.49252], loss: 7.775e-04\n",
      "iter 334: y_pred = [-0.50169,  0.20849,  0.07505, -0.49263], loss: 7.518e-04\n",
      "iter 335: y_pred = [-0.50167,  0.20839,  0.07549, -0.49273], loss: 7.269e-04\n",
      "iter 336: y_pred = [-0.50166,  0.20830,  0.07592, -0.49284], loss: 7.028e-04\n",
      "iter 337: y_pred = [-0.50164,  0.20821,  0.07635, -0.49294], loss: 6.793e-04\n",
      "iter 338: y_pred = [-0.50162,  0.20812,  0.07677, -0.49304], loss: 6.566e-04\n",
      "iter 339: y_pred = [-0.50160,  0.20802,  0.07718, -0.49314], loss: 6.346e-04\n",
      "iter 340: y_pred = [-0.50159,  0.20793,  0.07759, -0.49324], loss: 6.132e-04\n",
      "iter 341: y_pred = [-0.50157,  0.20784,  0.07799, -0.49334], loss: 5.925e-04\n",
      "iter 342: y_pred = [-0.50155,  0.20774,  0.07839, -0.49344], loss: 5.725e-04\n",
      "iter 343: y_pred = [-0.50153,  0.20765,  0.07878, -0.49354], loss: 5.530e-04\n",
      "iter 344: y_pred = [-0.50151,  0.20756,  0.07916, -0.49364], loss: 5.342e-04\n",
      "iter 345: y_pred = [-0.50150,  0.20746,  0.07954, -0.49373], loss: 5.159e-04\n",
      "iter 346: y_pred = [-0.50148,  0.20737,  0.07991, -0.49383], loss: 4.983e-04\n",
      "iter 347: y_pred = [-0.50146,  0.20728,  0.08027, -0.49392], loss: 4.812e-04\n",
      "iter 348: y_pred = [-0.50144,  0.20718,  0.08063, -0.49402], loss: 4.646e-04\n",
      "iter 349: y_pred = [-0.50142,  0.20709,  0.08099, -0.49411], loss: 4.486e-04\n",
      "iter 350: y_pred = [-0.50141,  0.20700,  0.08133, -0.49420], loss: 4.331e-04\n",
      "iter 351: y_pred = [-0.50139,  0.20691,  0.08167, -0.49429], loss: 4.180e-04\n",
      "iter 352: y_pred = [-0.50137,  0.20681,  0.08201, -0.49438], loss: 4.035e-04\n",
      "iter 353: y_pred = [-0.50135,  0.20672,  0.08234, -0.49447], loss: 3.894e-04\n",
      "iter 354: y_pred = [-0.50133,  0.20663,  0.08267, -0.49456], loss: 3.758e-04\n",
      "iter 355: y_pred = [-0.50132,  0.20654,  0.08299, -0.49465], loss: 3.627e-04\n",
      "iter 356: y_pred = [-0.50130,  0.20645,  0.08330, -0.49473], loss: 3.499e-04\n",
      "iter 357: y_pred = [-0.50128,  0.20636,  0.08361, -0.49482], loss: 3.376e-04\n",
      "iter 358: y_pred = [-0.50126,  0.20627,  0.08391, -0.49490], loss: 3.257e-04\n",
      "iter 359: y_pred = [-0.50124,  0.20618,  0.08421, -0.49498], loss: 3.142e-04\n",
      "iter 360: y_pred = [-0.50123,  0.20609,  0.08450, -0.49507], loss: 3.031e-04\n",
      "iter 361: y_pred = [-0.50121,  0.20601,  0.08479, -0.49515], loss: 2.924e-04\n",
      "iter 362: y_pred = [-0.50119,  0.20592,  0.08508, -0.49523], loss: 2.820e-04\n",
      "iter 363: y_pred = [-0.50118,  0.20583,  0.08535, -0.49530], loss: 2.719e-04\n",
      "iter 364: y_pred = [-0.50116,  0.20575,  0.08563, -0.49538], loss: 2.622e-04\n",
      "iter 365: y_pred = [-0.50114,  0.20566,  0.08590, -0.49546], loss: 2.529e-04\n",
      "iter 366: y_pred = [-0.50112,  0.20558,  0.08616, -0.49554], loss: 2.438e-04\n",
      "iter 367: y_pred = [-0.50111,  0.20550,  0.08642, -0.49561], loss: 2.351e-04\n",
      "iter 368: y_pred = [-0.50109,  0.20541,  0.08668, -0.49568], loss: 2.266e-04\n",
      "iter 369: y_pred = [-0.50107,  0.20533,  0.08693, -0.49576], loss: 2.185e-04\n",
      "iter 370: y_pred = [-0.50106,  0.20525,  0.08717, -0.49583], loss: 2.106e-04\n",
      "iter 371: y_pred = [-0.50104,  0.20517,  0.08741, -0.49590], loss: 2.030e-04\n",
      "iter 372: y_pred = [-0.50103,  0.20509,  0.08765, -0.49597], loss: 1.957e-04\n",
      "iter 373: y_pred = [-0.50101,  0.20501,  0.08788, -0.49604], loss: 1.886e-04\n",
      "iter 374: y_pred = [-0.50099,  0.20493,  0.08811, -0.49611], loss: 1.817e-04\n",
      "iter 375: y_pred = [-0.50098,  0.20485,  0.08834, -0.49617], loss: 1.751e-04\n",
      "iter 376: y_pred = [-0.50096,  0.20478,  0.08856, -0.49624], loss: 1.688e-04\n",
      "iter 377: y_pred = [-0.50095,  0.20470,  0.08878, -0.49631], loss: 1.626e-04\n",
      "iter 378: y_pred = [-0.50093,  0.20463,  0.08899, -0.49637], loss: 1.567e-04\n",
      "iter 379: y_pred = [-0.50092,  0.20455,  0.08920, -0.49643], loss: 1.510e-04\n",
      "iter 380: y_pred = [-0.50090,  0.20448,  0.08940, -0.49650], loss: 1.454e-04\n",
      "iter 381: y_pred = [-0.50089,  0.20441,  0.08961, -0.49656], loss: 1.401e-04\n",
      "iter 382: y_pred = [-0.50088,  0.20434,  0.08980, -0.49662], loss: 1.350e-04\n",
      "iter 383: y_pred = [-0.50086,  0.20427,  0.09000, -0.49668], loss: 1.300e-04\n",
      "iter 384: y_pred = [-0.50085,  0.20420,  0.09019, -0.49674], loss: 1.252e-04\n",
      "iter 385: y_pred = [-0.50083,  0.20413,  0.09038, -0.49679], loss: 1.206e-04\n",
      "iter 386: y_pred = [-0.50082,  0.20406,  0.09056, -0.49685], loss: 1.162e-04\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 387: y_pred = [-0.50081,  0.20399,  0.09074, -0.49691], loss: 1.119e-04\n",
      "iter 388: y_pred = [-0.50079,  0.20393,  0.09092, -0.49696], loss: 1.078e-04\n",
      "iter 389: y_pred = [-0.50078,  0.20386,  0.09109, -0.49702], loss: 1.038e-04\n",
      "iter 390: y_pred = [-0.50077,  0.20380,  0.09126, -0.49707], loss: 9.994e-05\n",
      "iter 391: y_pred = [-0.50075,  0.20373,  0.09143, -0.49712], loss: 9.624e-05\n",
      "iter 392: y_pred = [-0.50074,  0.20367,  0.09159, -0.49717], loss: 9.267e-05\n",
      "iter 393: y_pred = [-0.50073,  0.20361,  0.09176, -0.49722], loss: 8.923e-05\n",
      "iter 394: y_pred = [-0.50072,  0.20355,  0.09191, -0.49727], loss: 8.591e-05\n",
      "iter 395: y_pred = [-0.50070,  0.20349,  0.09207, -0.49732], loss: 8.271e-05\n",
      "iter 396: y_pred = [-0.50069,  0.20343,  0.09222, -0.49737], loss: 7.963e-05\n",
      "iter 397: y_pred = [-0.50068,  0.20337,  0.09237, -0.49742], loss: 7.666e-05\n",
      "iter 398: y_pred = [-0.50067,  0.20331,  0.09252, -0.49747], loss: 7.380e-05\n",
      "iter 399: y_pred = [-0.50066,  0.20325,  0.09266, -0.49751], loss: 7.105e-05\n",
      "iter 400: y_pred = [-0.50065,  0.20320,  0.09280, -0.49756], loss: 6.839e-05\n",
      "iter 401: y_pred = [-0.50063,  0.20314,  0.09294, -0.49760], loss: 6.583e-05\n",
      "iter 402: y_pred = [-0.50062,  0.20309,  0.09308, -0.49765], loss: 6.337e-05\n",
      "iter 403: y_pred = [-0.50061,  0.20303,  0.09321, -0.49769], loss: 6.099e-05\n",
      "iter 404: y_pred = [-0.50060,  0.20298,  0.09334, -0.49773], loss: 5.871e-05\n",
      "iter 405: y_pred = [-0.50059,  0.20293,  0.09347, -0.49777], loss: 5.650e-05\n",
      "iter 406: y_pred = [-0.50058,  0.20288,  0.09360, -0.49781], loss: 5.438e-05\n",
      "iter 407: y_pred = [-0.50057,  0.20283,  0.09372, -0.49785], loss: 5.233e-05\n",
      "iter 408: y_pred = [-0.50056,  0.20278,  0.09384, -0.49789], loss: 5.037e-05\n",
      "iter 409: y_pred = [-0.50055,  0.20273,  0.09396, -0.49793], loss: 4.847e-05\n",
      "iter 410: y_pred = [-0.50054,  0.20268,  0.09408, -0.49797], loss: 4.664e-05\n",
      "iter 411: y_pred = [-0.50053,  0.20263,  0.09419, -0.49801], loss: 4.488e-05\n",
      "iter 412: y_pred = [-0.50052,  0.20258,  0.09431, -0.49805], loss: 4.319e-05\n",
      "iter 413: y_pred = [-0.50051,  0.20254,  0.09442, -0.49808], loss: 4.156e-05\n",
      "iter 414: y_pred = [-0.50050,  0.20249,  0.09452, -0.49812], loss: 3.999e-05\n",
      "iter 415: y_pred = [-0.50049,  0.20245,  0.09463, -0.49815], loss: 3.848e-05\n",
      "iter 416: y_pred = [-0.50049,  0.20240,  0.09474, -0.49819], loss: 3.702e-05\n",
      "iter 417: y_pred = [-0.50048,  0.20236,  0.09484, -0.49822], loss: 3.562e-05\n",
      "iter 418: y_pred = [-0.50047,  0.20232,  0.09494, -0.49825], loss: 3.427e-05\n",
      "iter 419: y_pred = [-0.50046,  0.20228,  0.09504, -0.49829], loss: 3.297e-05\n",
      "iter 420: y_pred = [-0.50045,  0.20224,  0.09513, -0.49832], loss: 3.172e-05\n",
      "iter 421: y_pred = [-0.50044,  0.20220,  0.09523, -0.49835], loss: 3.052e-05\n",
      "iter 422: y_pred = [-0.50043,  0.20216,  0.09532, -0.49838], loss: 2.936e-05\n",
      "iter 423: y_pred = [-0.50043,  0.20212,  0.09541, -0.49841], loss: 2.825e-05\n",
      "iter 424: y_pred = [-0.50042,  0.20208,  0.09550, -0.49844], loss: 2.717e-05\n",
      "iter 425: y_pred = [-0.50041,  0.20204,  0.09559, -0.49847], loss: 2.614e-05\n",
      "iter 426: y_pred = [-0.50040,  0.20200,  0.09567, -0.49850], loss: 2.515e-05\n",
      "iter 427: y_pred = [-0.50040,  0.20197,  0.09576, -0.49853], loss: 2.419e-05\n",
      "iter 428: y_pred = [-0.50039,  0.20193,  0.09584, -0.49856], loss: 2.327e-05\n",
      "iter 429: y_pred = [-0.50038,  0.20189,  0.09592, -0.49858], loss: 2.238e-05\n",
      "iter 430: y_pred = [-0.50038,  0.20186,  0.09600, -0.49861], loss: 2.153e-05\n",
      "iter 431: y_pred = [-0.50037,  0.20183,  0.09608, -0.49864], loss: 2.071e-05\n",
      "iter 432: y_pred = [-0.50036,  0.20179,  0.09615, -0.49866], loss: 1.992e-05\n",
      "iter 433: y_pred = [-0.50035,  0.20176,  0.09623, -0.49869], loss: 1.916e-05\n",
      "iter 434: y_pred = [-0.50035,  0.20173,  0.09630, -0.49871], loss: 1.842e-05\n",
      "iter 435: y_pred = [-0.50034,  0.20169,  0.09638, -0.49874], loss: 1.772e-05\n",
      "iter 436: y_pred = [-0.50034,  0.20166,  0.09645, -0.49876], loss: 1.704e-05\n",
      "iter 437: y_pred = [-0.50033,  0.20163,  0.09652, -0.49878], loss: 1.639e-05\n",
      "iter 438: y_pred = [-0.50032,  0.20160,  0.09658, -0.49881], loss: 1.576e-05\n",
      "iter 439: y_pred = [-0.50032,  0.20157,  0.09665, -0.49883], loss: 1.516e-05\n",
      "iter 440: y_pred = [-0.50031,  0.20154,  0.09672, -0.49885], loss: 1.458e-05\n",
      "iter 441: y_pred = [-0.50031,  0.20151,  0.09678, -0.49887], loss: 1.402e-05\n",
      "iter 442: y_pred = [-0.50030,  0.20149,  0.09684, -0.49890], loss: 1.349e-05\n",
      "iter 443: y_pred = [-0.50029,  0.20146,  0.09690, -0.49892], loss: 1.297e-05\n",
      "iter 444: y_pred = [-0.50029,  0.20143,  0.09696, -0.49894], loss: 1.247e-05\n",
      "iter 445: y_pred = [-0.50028,  0.20140,  0.09702, -0.49896], loss: 1.199e-05\n",
      "iter 446: y_pred = [-0.50028,  0.20138,  0.09708, -0.49898], loss: 1.153e-05\n",
      "iter 447: y_pred = [-0.50027,  0.20135,  0.09714, -0.49900], loss: 1.109e-05\n",
      "iter 448: y_pred = [-0.50027,  0.20133,  0.09720, -0.49902], loss: 1.066e-05\n",
      "iter 449: y_pred = [-0.50026,  0.20130,  0.09725, -0.49904], loss: 1.026e-05\n",
      "iter 450: y_pred = [-0.50026,  0.20128,  0.09730, -0.49905], loss: 9.861e-06\n",
      "iter 451: y_pred = [-0.50025,  0.20125,  0.09736, -0.49907], loss: 9.483e-06\n",
      "iter 452: y_pred = [-0.50025,  0.20123,  0.09741, -0.49909], loss: 9.118e-06\n",
      "iter 453: y_pred = [-0.50024,  0.20121,  0.09746, -0.49911], loss: 8.768e-06\n",
      "iter 454: y_pred = [-0.50024,  0.20118,  0.09751, -0.49912], loss: 8.430e-06\n",
      "iter 455: y_pred = [-0.50023,  0.20116,  0.09756, -0.49914], loss: 8.106e-06\n",
      "iter 456: y_pred = [-0.50023,  0.20114,  0.09761, -0.49916], loss: 7.794e-06\n",
      "iter 457: y_pred = [-0.50023,  0.20112,  0.09765, -0.49917], loss: 7.494e-06\n",
      "iter 458: y_pred = [-0.50022,  0.20110,  0.09770, -0.49919], loss: 7.206e-06\n",
      "iter 459: y_pred = [-0.50022,  0.20108,  0.09774, -0.49921], loss: 6.928e-06\n",
      "iter 460: y_pred = [-0.50021,  0.20106,  0.09779, -0.49922], loss: 6.661e-06\n",
      "iter 461: y_pred = [-0.50021,  0.20104,  0.09783, -0.49924], loss: 6.405e-06\n",
      "iter 462: y_pred = [-0.50020,  0.20102,  0.09787, -0.49925], loss: 6.158e-06\n",
      "iter 463: y_pred = [-0.50020,  0.20100,  0.09792, -0.49926], loss: 5.920e-06\n",
      "iter 464: y_pred = [-0.50020,  0.20098,  0.09796, -0.49928], loss: 5.692e-06\n",
      "iter 465: y_pred = [-0.50019,  0.20096,  0.09800, -0.49929], loss: 5.472e-06\n",
      "iter 466: y_pred = [-0.50019,  0.20094,  0.09804, -0.49931], loss: 5.261e-06\n",
      "iter 467: y_pred = [-0.50019,  0.20092,  0.09807, -0.49932], loss: 5.058e-06\n",
      "iter 468: y_pred = [-0.50018,  0.20090,  0.09811, -0.49933], loss: 4.863e-06\n",
      "iter 469: y_pred = [-0.50018,  0.20089,  0.09815, -0.49935], loss: 4.675e-06\n",
      "iter 470: y_pred = [-0.50018,  0.20087,  0.09818, -0.49936], loss: 4.495e-06\n",
      "iter 471: y_pred = [-0.50017,  0.20085,  0.09822, -0.49937], loss: 4.321e-06\n",
      "iter 472: y_pred = [-0.50017,  0.20084,  0.09826, -0.49938], loss: 4.154e-06\n",
      "iter 473: y_pred = [-0.50017,  0.20082,  0.09829, -0.49940], loss: 3.994e-06\n",
      "iter 474: y_pred = [-0.50016,  0.20081,  0.09832, -0.49941], loss: 3.840e-06\n",
      "iter 475: y_pred = [-0.50016,  0.20079,  0.09836, -0.49942], loss: 3.691e-06\n",
      "iter 476: y_pred = [-0.50016,  0.20078,  0.09839, -0.49943], loss: 3.548e-06\n",
      "iter 477: y_pred = [-0.50015,  0.20076,  0.09842, -0.49944], loss: 3.411e-06\n",
      "iter 478: y_pred = [-0.50015,  0.20075,  0.09845, -0.49945], loss: 3.279e-06\n",
      "iter 479: y_pred = [-0.50015,  0.20073,  0.09848, -0.49946], loss: 3.153e-06\n",
      "iter 480: y_pred = [-0.50014,  0.20072,  0.09851, -0.49947], loss: 3.031e-06\n",
      "iter 481: y_pred = [-0.50014,  0.20070,  0.09854, -0.49948], loss: 2.913e-06\n",
      "iter 482: y_pred = [-0.50014,  0.20069,  0.09857, -0.49949], loss: 2.801e-06\n",
      "iter 483: y_pred = [-0.50014,  0.20068,  0.09860, -0.49950], loss: 2.692e-06\n",
      "iter 484: y_pred = [-0.50013,  0.20066,  0.09862, -0.49951], loss: 2.588e-06\n",
      "iter 485: y_pred = [-0.50013,  0.20065,  0.09865, -0.49952], loss: 2.488e-06\n",
      "iter 486: y_pred = [-0.50013,  0.20064,  0.09868, -0.49953], loss: 2.391e-06\n",
      "iter 487: y_pred = [-0.50013,  0.20063,  0.09870, -0.49954], loss: 2.299e-06\n",
      "iter 488: y_pred = [-0.50012,  0.20061,  0.09873, -0.49955], loss: 2.210e-06\n",
      "iter 489: y_pred = [-0.50012,  0.20060,  0.09875, -0.49956], loss: 2.124e-06\n",
      "iter 490: y_pred = [-0.50012,  0.20059,  0.09878, -0.49957], loss: 2.042e-06\n",
      "iter 491: y_pred = [-0.50012,  0.20058,  0.09880, -0.49958], loss: 1.963e-06\n",
      "iter 492: y_pred = [-0.50011,  0.20057,  0.09883, -0.49958], loss: 1.887e-06\n",
      "iter 493: y_pred = [-0.50011,  0.20056,  0.09885, -0.49959], loss: 1.814e-06\n",
      "iter 494: y_pred = [-0.50011,  0.20055,  0.09887, -0.49960], loss: 1.743e-06\n",
      "iter 495: y_pred = [-0.50011,  0.20054,  0.09889, -0.49961], loss: 1.676e-06\n",
      "iter 496: y_pred = [-0.50011,  0.20053,  0.09892, -0.49961], loss: 1.611e-06\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 497: y_pred = [-0.50010,  0.20052,  0.09894, -0.49962], loss: 1.548e-06\n",
      "iter 498: y_pred = [-0.50010,  0.20051,  0.09896, -0.49963], loss: 1.488e-06\n",
      "iter 499: y_pred = [-0.50010,  0.20050,  0.09898, -0.49964], loss: 1.430e-06\n",
      "iter 500: y_pred = [-0.50010,  0.20049,  0.09900, -0.49964], loss: 1.375e-06\n",
      "iter 501: y_pred = [-0.50010,  0.20048,  0.09902, -0.49965], loss: 1.322e-06\n",
      "iter 502: y_pred = [-0.50009,  0.20047,  0.09904, -0.49966], loss: 1.270e-06\n",
      "iter 503: y_pred = [-0.50009,  0.20046,  0.09906, -0.49966], loss: 1.221e-06\n",
      "iter 504: y_pred = [-0.50009,  0.20045,  0.09908, -0.49967], loss: 1.174e-06\n",
      "iter 505: y_pred = [-0.50009,  0.20044,  0.09909, -0.49968], loss: 1.128e-06\n",
      "iter 506: y_pred = [-0.50009,  0.20043,  0.09911, -0.49968], loss: 1.084e-06\n",
      "iter 507: y_pred = [-0.50009,  0.20042,  0.09913, -0.49969], loss: 1.042e-06\n",
      "iter 508: y_pred = [-0.50008,  0.20042,  0.09915, -0.49970], loss: 1.002e-06\n",
      "iter 509: y_pred = [-0.50008,  0.20041,  0.09916, -0.49970], loss: 9.629e-07\n",
      "iter 510: y_pred = [-0.50008,  0.20040,  0.09918, -0.49971], loss: 9.255e-07\n",
      "iter 511: y_pred = [-0.50008,  0.20039,  0.09920, -0.49971], loss: 8.895e-07\n",
      "iter 512: y_pred = [-0.50008,  0.20038,  0.09921, -0.49972], loss: 8.550e-07\n",
      "iter 513: y_pred = [-0.50008,  0.20038,  0.09923, -0.49972], loss: 8.218e-07\n",
      "iter 514: y_pred = [-0.50007,  0.20037,  0.09924, -0.49973], loss: 7.899e-07\n",
      "iter 515: y_pred = [-0.50007,  0.20036,  0.09926, -0.49974], loss: 7.592e-07\n",
      "iter 516: y_pred = [-0.50007,  0.20035,  0.09927, -0.49974], loss: 7.297e-07\n",
      "iter 517: y_pred = [-0.50007,  0.20035,  0.09929, -0.49975], loss: 7.013e-07\n",
      "iter 518: y_pred = [-0.50007,  0.20034,  0.09930, -0.49975], loss: 6.741e-07\n",
      "iter 519: y_pred = [-0.50007,  0.20033,  0.09931, -0.49976], loss: 6.479e-07\n",
      "iter 520: y_pred = [-0.50007,  0.20033,  0.09933, -0.49976], loss: 6.227e-07\n",
      "iter 521: y_pred = [-0.50006,  0.20032,  0.09934, -0.49976], loss: 5.985e-07\n",
      "iter 522: y_pred = [-0.50006,  0.20032,  0.09935, -0.49977], loss: 5.752e-07\n",
      "iter 523: y_pred = [-0.50006,  0.20031,  0.09937, -0.49977], loss: 5.529e-07\n",
      "iter 524: y_pred = [-0.50006,  0.20030,  0.09938, -0.49978], loss: 5.314e-07\n",
      "iter 525: y_pred = [-0.50006,  0.20030,  0.09939, -0.49978], loss: 5.107e-07\n",
      "iter 526: y_pred = [-0.50006,  0.20029,  0.09940, -0.49979], loss: 4.909e-07\n",
      "iter 527: y_pred = [-0.50006,  0.20029,  0.09941, -0.49979], loss: 4.718e-07\n",
      "iter 528: y_pred = [-0.50006,  0.20028,  0.09943, -0.49980], loss: 4.534e-07\n",
      "iter 529: y_pred = [-0.50006,  0.20027,  0.09944, -0.49980], loss: 4.358e-07\n",
      "iter 530: y_pred = [-0.50005,  0.20027,  0.09945, -0.49980], loss: 4.188e-07\n",
      "iter 531: y_pred = [-0.50005,  0.20026,  0.09946, -0.49981], loss: 4.026e-07\n",
      "iter 532: y_pred = [-0.50005,  0.20026,  0.09947, -0.49981], loss: 3.869e-07\n",
      "iter 533: y_pred = [-0.50005,  0.20025,  0.09948, -0.49981], loss: 3.718e-07\n",
      "iter 534: y_pred = [-0.50005,  0.20025,  0.09949, -0.49982], loss: 3.574e-07\n",
      "iter 535: y_pred = [-0.50005,  0.20024,  0.09950, -0.49982], loss: 3.435e-07\n",
      "iter 536: y_pred = [-0.50005,  0.20024,  0.09951, -0.49983], loss: 3.301e-07\n",
      "iter 537: y_pred = [-0.50005,  0.20023,  0.09952, -0.49983], loss: 3.173e-07\n",
      "iter 538: y_pred = [-0.50005,  0.20023,  0.09953, -0.49983], loss: 3.049e-07\n",
      "iter 539: y_pred = [-0.50005,  0.20023,  0.09954, -0.49984], loss: 2.931e-07\n",
      "iter 540: y_pred = [-0.50004,  0.20022,  0.09955, -0.49984], loss: 2.817e-07\n",
      "iter 541: y_pred = [-0.50004,  0.20022,  0.09956, -0.49984], loss: 2.707e-07\n",
      "iter 542: y_pred = [-0.50004,  0.20021,  0.09957, -0.49984], loss: 2.602e-07\n",
      "iter 543: y_pred = [-0.50004,  0.20021,  0.09957, -0.49985], loss: 2.500e-07\n",
      "iter 544: y_pred = [-0.50004,  0.20020,  0.09958, -0.49985], loss: 2.403e-07\n",
      "iter 545: y_pred = [-0.50004,  0.20020,  0.09959, -0.49985], loss: 2.309e-07\n",
      "iter 546: y_pred = [-0.50004,  0.20020,  0.09960, -0.49986], loss: 2.220e-07\n",
      "iter 547: y_pred = [-0.50004,  0.20019,  0.09961, -0.49986], loss: 2.133e-07\n",
      "iter 548: y_pred = [-0.50004,  0.20019,  0.09961, -0.49986], loss: 2.050e-07\n",
      "iter 549: y_pred = [-0.50004,  0.20019,  0.09962, -0.49986], loss: 1.970e-07\n",
      "iter 550: y_pred = [-0.50004,  0.20018,  0.09963, -0.49987], loss: 1.894e-07\n",
      "iter 551: y_pred = [-0.50004,  0.20018,  0.09964, -0.49987], loss: 1.820e-07\n",
      "iter 552: y_pred = [-0.50004,  0.20017,  0.09964, -0.49987], loss: 1.749e-07\n",
      "iter 553: y_pred = [-0.50003,  0.20017,  0.09965, -0.49988], loss: 1.681e-07\n",
      "iter 554: y_pred = [-0.50003,  0.20017,  0.09966, -0.49988], loss: 1.615e-07\n",
      "iter 555: y_pred = [-0.50003,  0.20016,  0.09966, -0.49988], loss: 1.553e-07\n",
      "iter 556: y_pred = [-0.50003,  0.20016,  0.09967, -0.49988], loss: 1.492e-07\n",
      "iter 557: y_pred = [-0.50003,  0.20016,  0.09968, -0.49988], loss: 1.434e-07\n",
      "iter 558: y_pred = [-0.50003,  0.20015,  0.09968, -0.49989], loss: 1.378e-07\n",
      "iter 559: y_pred = [-0.50003,  0.20015,  0.09969, -0.49989], loss: 1.324e-07\n",
      "iter 560: y_pred = [-0.50003,  0.20015,  0.09970, -0.49989], loss: 1.273e-07\n",
      "iter 561: y_pred = [-0.50003,  0.20015,  0.09970, -0.49989], loss: 1.223e-07\n",
      "iter 562: y_pred = [-0.50003,  0.20014,  0.09971, -0.49990], loss: 1.176e-07\n",
      "iter 563: y_pred = [-0.50003,  0.20014,  0.09971, -0.49990], loss: 1.130e-07\n",
      "iter 564: y_pred = [-0.50003,  0.20014,  0.09972, -0.49990], loss: 1.086e-07\n",
      "iter 565: y_pred = [-0.50003,  0.20013,  0.09972, -0.49990], loss: 1.044e-07\n",
      "iter 566: y_pred = [-0.50003,  0.20013,  0.09973, -0.49990], loss: 1.003e-07\n",
      "iter 567: y_pred = [-0.50003,  0.20013,  0.09974, -0.49991], loss: 9.639e-08\n",
      "iter 568: y_pred = [-0.50003,  0.20013,  0.09974, -0.49991], loss: 9.263e-08\n",
      "iter 569: y_pred = [-0.50003,  0.20012,  0.09975, -0.49991], loss: 8.902e-08\n",
      "iter 570: y_pred = [-0.50002,  0.20012,  0.09975, -0.49991], loss: 8.555e-08\n",
      "iter 571: y_pred = [-0.50002,  0.20012,  0.09976, -0.49991], loss: 8.222e-08\n",
      "iter 572: y_pred = [-0.50002,  0.20012,  0.09976, -0.49991], loss: 7.902e-08\n",
      "iter 573: y_pred = [-0.50002,  0.20012,  0.09977, -0.49992], loss: 7.594e-08\n",
      "iter 574: y_pred = [-0.50002,  0.20011,  0.09977, -0.49992], loss: 7.298e-08\n",
      "iter 575: y_pred = [-0.50002,  0.20011,  0.09977, -0.49992], loss: 7.014e-08\n",
      "iter 576: y_pred = [-0.50002,  0.20011,  0.09978, -0.49992], loss: 6.740e-08\n",
      "iter 577: y_pred = [-0.50002,  0.20011,  0.09978, -0.49992], loss: 6.478e-08\n",
      "iter 578: y_pred = [-0.50002,  0.20010,  0.09979, -0.49992], loss: 6.225e-08\n",
      "iter 579: y_pred = [-0.50002,  0.20010,  0.09979, -0.49993], loss: 5.983e-08\n",
      "iter 580: y_pred = [-0.50002,  0.20010,  0.09980, -0.49993], loss: 5.750e-08\n",
      "iter 581: y_pred = [-0.50002,  0.20010,  0.09980, -0.49993], loss: 5.525e-08\n",
      "iter 582: y_pred = [-0.50002,  0.20010,  0.09980, -0.49993], loss: 5.310e-08\n",
      "iter 583: y_pred = [-0.50002,  0.20009,  0.09981, -0.49993], loss: 5.103e-08\n",
      "iter 584: y_pred = [-0.50002,  0.20009,  0.09981, -0.49993], loss: 4.904e-08\n",
      "iter 585: y_pred = [-0.50002,  0.20009,  0.09982, -0.49993], loss: 4.713e-08\n",
      "iter 586: y_pred = [-0.50002,  0.20009,  0.09982, -0.49994], loss: 4.530e-08\n",
      "iter 587: y_pred = [-0.50002,  0.20009,  0.09982, -0.49994], loss: 4.353e-08\n",
      "iter 588: y_pred = [-0.50002,  0.20009,  0.09983, -0.49994], loss: 4.183e-08\n",
      "iter 589: y_pred = [-0.50002,  0.20008,  0.09983, -0.49994], loss: 4.020e-08\n",
      "iter 590: y_pred = [-0.50002,  0.20008,  0.09983, -0.49994], loss: 3.864e-08\n",
      "iter 591: y_pred = [-0.50002,  0.20008,  0.09984, -0.49994], loss: 3.713e-08\n",
      "iter 592: y_pred = [-0.50002,  0.20008,  0.09984, -0.49994], loss: 3.568e-08\n",
      "iter 593: y_pred = [-0.50002,  0.20008,  0.09984, -0.49994], loss: 3.429e-08\n",
      "iter 594: y_pred = [-0.50002,  0.20008,  0.09985, -0.49994], loss: 3.295e-08\n",
      "iter 595: y_pred = [-0.50001,  0.20007,  0.09985, -0.49995], loss: 3.167e-08\n",
      "iter 596: y_pred = [-0.50001,  0.20007,  0.09985, -0.49995], loss: 3.044e-08\n",
      "iter 597: y_pred = [-0.50001,  0.20007,  0.09985, -0.49995], loss: 2.925e-08\n",
      "iter 598: y_pred = [-0.50001,  0.20007,  0.09986, -0.49995], loss: 2.811e-08\n",
      "iter 599: y_pred = [-0.50001,  0.20007,  0.09986, -0.49995], loss: 2.701e-08\n",
      "iter 600: y_pred = [-0.50001,  0.20007,  0.09986, -0.49995], loss: 2.596e-08\n",
      "iter 601: y_pred = [-0.50001,  0.20007,  0.09987, -0.49995], loss: 2.495e-08\n",
      "iter 602: y_pred = [-0.50001,  0.20006,  0.09987, -0.49995], loss: 2.398e-08\n",
      "iter 603: y_pred = [-0.50001,  0.20006,  0.09987, -0.49995], loss: 2.304e-08\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 604: y_pred = [-0.50001,  0.20006,  0.09987, -0.49995], loss: 2.214e-08\n",
      "iter 605: y_pred = [-0.50001,  0.20006,  0.09988, -0.49996], loss: 2.128e-08\n",
      "iter 606: y_pred = [-0.50001,  0.20006,  0.09988, -0.49996], loss: 2.045e-08\n",
      "iter 607: y_pred = [-0.50001,  0.20006,  0.09988, -0.49996], loss: 1.965e-08\n",
      "iter 608: y_pred = [-0.50001,  0.20006,  0.09988, -0.49996], loss: 1.889e-08\n",
      "iter 609: y_pred = [-0.50001,  0.20006,  0.09989, -0.49996], loss: 1.815e-08\n",
      "iter 610: y_pred = [-0.50001,  0.20006,  0.09989, -0.49996], loss: 1.744e-08\n",
      "iter 611: y_pred = [-0.50001,  0.20005,  0.09989, -0.49996], loss: 1.676e-08\n",
      "iter 612: y_pred = [-0.50001,  0.20005,  0.09989, -0.49996], loss: 1.611e-08\n",
      "iter 613: y_pred = [-0.50001,  0.20005,  0.09989, -0.49996], loss: 1.548e-08\n",
      "iter 614: y_pred = [-0.50001,  0.20005,  0.09990, -0.49996], loss: 1.488e-08\n",
      "iter 615: y_pred = [-0.50001,  0.20005,  0.09990, -0.49996], loss: 1.430e-08\n",
      "iter 616: y_pred = [-0.50001,  0.20005,  0.09990, -0.49996], loss: 1.374e-08\n",
      "iter 617: y_pred = [-0.50001,  0.20005,  0.09990, -0.49996], loss: 1.320e-08\n",
      "iter 618: y_pred = [-0.50001,  0.20005,  0.09990, -0.49997], loss: 1.269e-08\n",
      "iter 619: y_pred = [-0.50001,  0.20005,  0.09991, -0.49997], loss: 1.219e-08\n",
      "iter 620: y_pred = [-0.50001,  0.20005,  0.09991, -0.49997], loss: 1.172e-08\n",
      "iter 621: y_pred = [-0.50001,  0.20004,  0.09991, -0.49997], loss: 1.126e-08\n",
      "iter 622: y_pred = [-0.50001,  0.20004,  0.09991, -0.49997], loss: 1.082e-08\n",
      "iter 623: y_pred = [-0.50001,  0.20004,  0.09991, -0.49997], loss: 1.040e-08\n",
      "iter 624: y_pred = [-0.50001,  0.20004,  0.09991, -0.49997], loss: 9.995e-09\n",
      "iter 625: y_pred = [-0.50001,  0.20004,  0.09992, -0.49997], loss: 9.605e-09\n",
      "iter 626: y_pred = [-0.50001,  0.20004,  0.09992, -0.49997], loss: 9.231e-09\n",
      "iter 627: y_pred = [-0.50001,  0.20004,  0.09992, -0.49997], loss: 8.871e-09\n",
      "iter 628: y_pred = [-0.50001,  0.20004,  0.09992, -0.49997], loss: 8.525e-09\n",
      "iter 629: y_pred = [-0.50001,  0.20004,  0.09992, -0.49997], loss: 8.192e-09\n",
      "iter 630: y_pred = [-0.50001,  0.20004,  0.09992, -0.49997], loss: 7.873e-09\n",
      "iter 631: y_pred = [-0.50001,  0.20004,  0.09993, -0.49997], loss: 7.566e-09\n",
      "iter 632: y_pred = [-0.50001,  0.20004,  0.09993, -0.49997], loss: 7.271e-09\n",
      "iter 633: y_pred = [-0.50001,  0.20003,  0.09993, -0.49997], loss: 6.987e-09\n",
      "iter 634: y_pred = [-0.50001,  0.20003,  0.09993, -0.49998], loss: 6.715e-09\n",
      "iter 635: y_pred = [-0.50001,  0.20003,  0.09993, -0.49998], loss: 6.453e-09\n",
      "iter 636: y_pred = [-0.50001,  0.20003,  0.09993, -0.49998], loss: 6.201e-09\n",
      "iter 637: y_pred = [-0.50001,  0.20003,  0.09993, -0.49998], loss: 5.959e-09\n",
      "iter 638: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 5.727e-09\n",
      "iter 639: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 5.504e-09\n",
      "iter 640: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 5.289e-09\n",
      "iter 641: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 5.083e-09\n",
      "iter 642: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 4.884e-09\n",
      "iter 643: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 4.694e-09\n",
      "iter 644: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 4.511e-09\n",
      "iter 645: y_pred = [-0.50001,  0.20003,  0.09994, -0.49998], loss: 4.335e-09\n",
      "iter 646: y_pred = [-0.50001,  0.20003,  0.09995, -0.49998], loss: 4.166e-09\n",
      "iter 647: y_pred = [-0.50001,  0.20003,  0.09995, -0.49998], loss: 4.003e-09\n",
      "iter 648: y_pred = [-0.50001,  0.20003,  0.09995, -0.49998], loss: 3.847e-09\n",
      "iter 649: y_pred = [-0.50001,  0.20003,  0.09995, -0.49998], loss: 3.697e-09\n",
      "iter 650: y_pred = [-0.50001,  0.20002,  0.09995, -0.49998], loss: 3.553e-09\n",
      "iter 651: y_pred = [-0.50000,  0.20002,  0.09995, -0.49998], loss: 3.414e-09\n",
      "iter 652: y_pred = [-0.50000,  0.20002,  0.09995, -0.49998], loss: 3.281e-09\n",
      "iter 653: y_pred = [-0.50000,  0.20002,  0.09995, -0.49998], loss: 3.153e-09\n",
      "iter 654: y_pred = [-0.50000,  0.20002,  0.09995, -0.49998], loss: 3.030e-09\n",
      "iter 655: y_pred = [-0.50000,  0.20002,  0.09995, -0.49998], loss: 2.912e-09\n",
      "iter 656: y_pred = [-0.50000,  0.20002,  0.09995, -0.49998], loss: 2.798e-09\n",
      "iter 657: y_pred = [-0.50000,  0.20002,  0.09996, -0.49998], loss: 2.689e-09\n",
      "iter 658: y_pred = [-0.50000,  0.20002,  0.09996, -0.49998], loss: 2.584e-09\n",
      "iter 659: y_pred = [-0.50000,  0.20002,  0.09996, -0.49998], loss: 2.484e-09\n",
      "iter 660: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 2.387e-09\n",
      "iter 661: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 2.294e-09\n",
      "iter 662: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 2.204e-09\n",
      "iter 663: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 2.118e-09\n",
      "iter 664: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 2.036e-09\n",
      "iter 665: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 1.956e-09\n",
      "iter 666: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 1.880e-09\n",
      "iter 667: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 1.807e-09\n",
      "iter 668: y_pred = [-0.50000,  0.20002,  0.09996, -0.49999], loss: 1.736e-09\n",
      "iter 669: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.668e-09\n",
      "iter 670: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.603e-09\n",
      "iter 671: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.541e-09\n",
      "iter 672: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.481e-09\n",
      "iter 673: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.423e-09\n",
      "iter 674: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.367e-09\n",
      "iter 675: y_pred = [-0.50000,  0.20002,  0.09997, -0.49999], loss: 1.314e-09\n",
      "iter 676: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 1.263e-09\n",
      "iter 677: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 1.214e-09\n",
      "iter 678: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 1.166e-09\n",
      "iter 679: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 1.121e-09\n",
      "iter 680: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 1.077e-09\n",
      "iter 681: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 1.035e-09\n",
      "iter 682: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 9.946e-10\n",
      "iter 683: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 9.558e-10\n",
      "iter 684: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 9.185e-10\n",
      "iter 685: y_pred = [-0.50000,  0.20001,  0.09997, -0.49999], loss: 8.827e-10\n",
      "iter 686: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 8.483e-10\n",
      "iter 687: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 8.152e-10\n",
      "iter 688: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 7.834e-10\n",
      "iter 689: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 7.528e-10\n",
      "iter 690: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 7.235e-10\n",
      "iter 691: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 6.952e-10\n",
      "iter 692: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 6.681e-10\n",
      "iter 693: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 6.420e-10\n",
      "iter 694: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 6.170e-10\n",
      "iter 695: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 5.929e-10\n",
      "iter 696: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 5.698e-10\n",
      "iter 697: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 5.476e-10\n",
      "iter 698: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 5.262e-10\n",
      "iter 699: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 5.057e-10\n",
      "iter 700: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 4.860e-10\n",
      "iter 701: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 4.670e-10\n",
      "iter 702: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 4.488e-10\n",
      "iter 703: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 4.313e-10\n",
      "iter 704: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 4.145e-10\n",
      "iter 705: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.983e-10\n",
      "iter 706: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.827e-10\n",
      "iter 707: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.678e-10\n",
      "iter 708: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.535e-10\n",
      "iter 709: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.397e-10\n",
      "iter 710: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.264e-10\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 711: y_pred = [-0.50000,  0.20001,  0.09998, -0.49999], loss: 3.137e-10\n",
      "iter 712: y_pred = [-0.50000,  0.20001,  0.09999, -0.49999], loss: 3.015e-10\n",
      "iter 713: y_pred = [-0.50000,  0.20001,  0.09999, -0.49999], loss: 2.897e-10\n",
      "iter 714: y_pred = [-0.50000,  0.20001,  0.09999, -0.49999], loss: 2.784e-10\n",
      "iter 715: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.675e-10\n",
      "iter 716: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.571e-10\n",
      "iter 717: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.471e-10\n",
      "iter 718: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.374e-10\n",
      "iter 719: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.282e-10\n",
      "iter 720: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.193e-10\n",
      "iter 721: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.107e-10\n",
      "iter 722: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 2.025e-10\n",
      "iter 723: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.946e-10\n",
      "iter 724: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.870e-10\n",
      "iter 725: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.797e-10\n",
      "iter 726: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.727e-10\n",
      "iter 727: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.660e-10\n",
      "iter 728: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.595e-10\n",
      "iter 729: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.533e-10\n",
      "iter 730: y_pred = [-0.50000,  0.20001,  0.09999, -0.50000], loss: 1.473e-10\n",
      "iter 731: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.415e-10\n",
      "iter 732: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.360e-10\n",
      "iter 733: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.307e-10\n",
      "iter 734: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.256e-10\n",
      "iter 735: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.207e-10\n",
      "iter 736: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.160e-10\n",
      "iter 737: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.115e-10\n",
      "iter 738: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.071e-10\n",
      "iter 739: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 1.029e-10\n",
      "iter 740: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 9.893e-11\n",
      "iter 741: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 9.507e-11\n",
      "iter 742: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 9.136e-11\n",
      "iter 743: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 8.780e-11\n",
      "iter 744: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 8.437e-11\n",
      "iter 745: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 8.108e-11\n",
      "iter 746: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 7.792e-11\n",
      "iter 747: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 7.488e-11\n",
      "iter 748: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 7.196e-11\n",
      "iter 749: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 6.915e-11\n",
      "iter 750: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 6.645e-11\n",
      "iter 751: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 6.386e-11\n",
      "iter 752: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 6.137e-11\n",
      "iter 753: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 5.897e-11\n",
      "iter 754: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 5.667e-11\n",
      "iter 755: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 5.446e-11\n",
      "iter 756: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 5.234e-11\n",
      "iter 757: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 5.030e-11\n",
      "iter 758: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 4.833e-11\n",
      "iter 759: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 4.645e-11\n",
      "iter 760: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 4.464e-11\n",
      "iter 761: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 4.290e-11\n",
      "iter 762: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 4.122e-11\n",
      "iter 763: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 3.961e-11\n",
      "iter 764: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 3.807e-11\n",
      "iter 765: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 3.658e-11\n",
      "iter 766: y_pred = [-0.50000,  0.20000,  0.09999, -0.50000], loss: 3.516e-11\n",
      "iter 767: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.378e-11\n",
      "iter 768: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.247e-11\n",
      "iter 769: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.120e-11\n",
      "iter 770: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.998e-11\n",
      "iter 771: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.881e-11\n",
      "iter 772: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.769e-11\n",
      "iter 773: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.661e-11\n",
      "iter 774: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.557e-11\n",
      "iter 775: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.457e-11\n",
      "iter 776: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.361e-11\n",
      "iter 777: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.269e-11\n",
      "iter 778: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.181e-11\n",
      "iter 779: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.096e-11\n",
      "iter 780: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.014e-11\n",
      "iter 781: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.935e-11\n",
      "iter 782: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.860e-11\n",
      "iter 783: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.787e-11\n",
      "iter 784: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.718e-11\n",
      "iter 785: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.651e-11\n",
      "iter 786: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.586e-11\n",
      "iter 787: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.524e-11\n",
      "iter 788: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.465e-11\n",
      "iter 789: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.408e-11\n",
      "iter 790: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.353e-11\n",
      "iter 791: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.300e-11\n",
      "iter 792: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.249e-11\n",
      "iter 793: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.201e-11\n",
      "iter 794: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.154e-11\n",
      "iter 795: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.109e-11\n",
      "iter 796: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.065e-11\n",
      "iter 797: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.024e-11\n",
      "iter 798: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.839e-12\n",
      "iter 799: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.455e-12\n",
      "iter 800: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.086e-12\n",
      "iter 801: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.732e-12\n",
      "iter 802: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.391e-12\n",
      "iter 803: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.064e-12\n",
      "iter 804: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.749e-12\n",
      "iter 805: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.447e-12\n",
      "iter 806: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.156e-12\n",
      "iter 807: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.877e-12\n",
      "iter 808: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.609e-12\n",
      "iter 809: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.351e-12\n",
      "iter 810: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.103e-12\n",
      "iter 811: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.865e-12\n",
      "iter 812: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.636e-12\n",
      "iter 813: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.416e-12\n",
      "iter 814: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.205e-12\n",
      "iter 815: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.002e-12\n",
      "iter 816: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.807e-12\n",
      "iter 817: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.619e-12\n",
      "iter 818: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.439e-12\n",
      "iter 819: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.266e-12\n",
      "iter 820: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.100e-12\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 821: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.940e-12\n",
      "iter 822: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.786e-12\n",
      "iter 823: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.638e-12\n",
      "iter 824: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.496e-12\n",
      "iter 825: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.360e-12\n",
      "iter 826: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.229e-12\n",
      "iter 827: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.103e-12\n",
      "iter 828: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.982e-12\n",
      "iter 829: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.865e-12\n",
      "iter 830: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.754e-12\n",
      "iter 831: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.646e-12\n",
      "iter 832: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.543e-12\n",
      "iter 833: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.444e-12\n",
      "iter 834: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.348e-12\n",
      "iter 835: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.257e-12\n",
      "iter 836: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.169e-12\n",
      "iter 837: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.084e-12\n",
      "iter 838: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.003e-12\n",
      "iter 839: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.925e-12\n",
      "iter 840: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.850e-12\n",
      "iter 841: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.777e-12\n",
      "iter 842: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.708e-12\n",
      "iter 843: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.641e-12\n",
      "iter 844: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.577e-12\n",
      "iter 845: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.516e-12\n",
      "iter 846: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.457e-12\n",
      "iter 847: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.400e-12\n",
      "iter 848: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.345e-12\n",
      "iter 849: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.293e-12\n",
      "iter 850: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.242e-12\n",
      "iter 851: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.194e-12\n",
      "iter 852: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.147e-12\n",
      "iter 853: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.103e-12\n",
      "iter 854: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.060e-12\n",
      "iter 855: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.018e-12\n",
      "iter 856: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.785e-13\n",
      "iter 857: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.403e-13\n",
      "iter 858: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.036e-13\n",
      "iter 859: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.684e-13\n",
      "iter 860: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.345e-13\n",
      "iter 861: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.019e-13\n",
      "iter 862: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.706e-13\n",
      "iter 863: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.406e-13\n",
      "iter 864: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.117e-13\n",
      "iter 865: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.839e-13\n",
      "iter 866: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.572e-13\n",
      "iter 867: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.316e-13\n",
      "iter 868: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.070e-13\n",
      "iter 869: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.833e-13\n",
      "iter 870: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.605e-13\n",
      "iter 871: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.387e-13\n",
      "iter 872: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.176e-13\n",
      "iter 873: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.974e-13\n",
      "iter 874: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.780e-13\n",
      "iter 875: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.594e-13\n",
      "iter 876: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.415e-13\n",
      "iter 877: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.242e-13\n",
      "iter 878: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.077e-13\n",
      "iter 879: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.918e-13\n",
      "iter 880: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.765e-13\n",
      "iter 881: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.618e-13\n",
      "iter 882: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.477e-13\n",
      "iter 883: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.341e-13\n",
      "iter 884: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.211e-13\n",
      "iter 885: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.086e-13\n",
      "iter 886: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.965e-13\n",
      "iter 887: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.850e-13\n",
      "iter 888: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.738e-13\n",
      "iter 889: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.632e-13\n",
      "iter 890: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.529e-13\n",
      "iter 891: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.430e-13\n",
      "iter 892: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.335e-13\n",
      "iter 893: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.244e-13\n",
      "iter 894: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.157e-13\n",
      "iter 895: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.073e-13\n",
      "iter 896: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.992e-13\n",
      "iter 897: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.914e-13\n",
      "iter 898: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.839e-13\n",
      "iter 899: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.768e-13\n",
      "iter 900: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.699e-13\n",
      "iter 901: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.632e-13\n",
      "iter 902: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.569e-13\n",
      "iter 903: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.507e-13\n",
      "iter 904: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.449e-13\n",
      "iter 905: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.392e-13\n",
      "iter 906: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.338e-13\n",
      "iter 907: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.286e-13\n",
      "iter 908: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.235e-13\n",
      "iter 909: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.187e-13\n",
      "iter 910: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.141e-13\n",
      "iter 911: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.096e-13\n",
      "iter 912: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.054e-13\n",
      "iter 913: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.013e-13\n",
      "iter 914: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.731e-14\n",
      "iter 915: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.351e-14\n",
      "iter 916: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.986e-14\n",
      "iter 917: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.636e-14\n",
      "iter 918: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.299e-14\n",
      "iter 919: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.975e-14\n",
      "iter 920: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.664e-14\n",
      "iter 921: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.365e-14\n",
      "iter 922: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.078e-14\n",
      "iter 923: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.801e-14\n",
      "iter 924: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.536e-14\n",
      "iter 925: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.281e-14\n",
      "iter 926: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.036e-14\n",
      "iter 927: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.801e-14\n",
      "iter 928: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.574e-14\n",
      "iter 929: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.357e-14\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "iter 930: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.148e-14\n",
      "iter 931: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.947e-14\n",
      "iter 932: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.754e-14\n",
      "iter 933: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.568e-14\n",
      "iter 934: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.390e-14\n",
      "iter 935: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.219e-14\n",
      "iter 936: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.054e-14\n",
      "iter 937: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.896e-14\n",
      "iter 938: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.744e-14\n",
      "iter 939: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.598e-14\n",
      "iter 940: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.458e-14\n",
      "iter 941: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.323e-14\n",
      "iter 942: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.193e-14\n",
      "iter 943: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.069e-14\n",
      "iter 944: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.949e-14\n",
      "iter 945: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.834e-14\n",
      "iter 946: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.723e-14\n",
      "iter 947: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.617e-14\n",
      "iter 948: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.515e-14\n",
      "iter 949: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.417e-14\n",
      "iter 950: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.323e-14\n",
      "iter 951: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.232e-14\n",
      "iter 952: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.145e-14\n",
      "iter 953: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 2.061e-14\n",
      "iter 954: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.981e-14\n",
      "iter 955: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.903e-14\n",
      "iter 956: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.829e-14\n",
      "iter 957: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.758e-14\n",
      "iter 958: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.689e-14\n",
      "iter 959: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.623e-14\n",
      "iter 960: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.560e-14\n",
      "iter 961: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.499e-14\n",
      "iter 962: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.441e-14\n",
      "iter 963: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.384e-14\n",
      "iter 964: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.330e-14\n",
      "iter 965: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.279e-14\n",
      "iter 966: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.229e-14\n",
      "iter 967: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.181e-14\n",
      "iter 968: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.135e-14\n",
      "iter 969: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.090e-14\n",
      "iter 970: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.048e-14\n",
      "iter 971: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 1.007e-14\n",
      "iter 972: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.677e-15\n",
      "iter 973: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 9.299e-15\n",
      "iter 974: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.937e-15\n",
      "iter 975: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.588e-15\n",
      "iter 976: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 8.253e-15\n",
      "iter 977: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.931e-15\n",
      "iter 978: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.621e-15\n",
      "iter 979: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.324e-15\n",
      "iter 980: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 7.038e-15\n",
      "iter 981: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.764e-15\n",
      "iter 982: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.500e-15\n",
      "iter 983: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.246e-15\n",
      "iter 984: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 6.003e-15\n",
      "iter 985: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.768e-15\n",
      "iter 986: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.543e-15\n",
      "iter 987: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.327e-15\n",
      "iter 988: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 5.119e-15\n",
      "iter 989: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.920e-15\n",
      "iter 990: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.728e-15\n",
      "iter 991: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.543e-15\n",
      "iter 992: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.366e-15\n",
      "iter 993: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.196e-15\n",
      "iter 994: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 4.032e-15\n",
      "iter 995: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.875e-15\n",
      "iter 996: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.723e-15\n",
      "iter 997: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.578e-15\n",
      "iter 998: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.439e-15\n",
      "iter 999: y_pred = [-0.50000,  0.20000,  0.10000, -0.50000], loss: 3.304e-15\n"
     ]
    }
   ],
   "source": [
    "for cur_iter in range(1000):\n",
    "        print(\"iter\", \"%2s\" % str(cur_iter), end=\": \")\n",
    "        for ind in range(len(y_list)):\n",
    "            lstm_net.x_list_add(input_val_arr[ind])\n",
    "\n",
    "        print(\"y_pred = [\" +\n",
    "              \", \".join([\"% 2.5f\" % lstm_net.lstm_node_list[ind].state.h[0] for ind in range(len(y_list))]) +\n",
    "              \"]\", end=\", \")\n",
    "\n",
    "        loss = lstm_net.y_list_is(y_list, ToyLossLayer)\n",
    "        print(\"loss:\", \"%.3e\" % loss)\n",
    "        lstm_param.apply_diff(lr=0.1)\n",
    "        lstm_net.x_list_clear()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py3.5",
   "language": "python",
   "name": "py3.5"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
